Parameters Style property

Official Content
This documentation is valid for:
Defines that the generated application will be using the standard URL query component style (identifying each parameter by its name) or another supported style.

Values

Named Parameters in the URL are named and separated by an ampersand (&)
Positional Parameters in the URL are positional and separated by a comma (,)

Scope

Generators: Java, .NET, .NET Core
Level: Environment

Description

Parameters are named by default in new Environments. This is to follow common or standard URL writing styles, and easies Web Application Firewall (WAF) configuration among other benefits.

When the Parameters Style is Named, the parameters will appear in the query string of the URL as

?ParameterName1=value1&ParameterName2=value2...&ParameterNameN=valueN

Furthermore, the order of appearance in the query string is not relevant:

?ParameterName1=value1&ParameterName2=value2

is equivalent to 

?ParameterName2=value2&ParameterName1=value1

When the Parameters Style is Positional, the parameters will appear in the query of the URL as

?value1,value2,..valueN

Notes

  • Programs can read parameters received in a positional style even if the property is set to Named
  • Dynamic calls or Dynamic links use or create URLs in a positional style, they are not affected by this property
  • URL of programs with encrypted parameters is not affected by this property

Considerations when changing from Positional to Named

When you change this property from Positional to Named, all code you wrote in GeneXus should keep working as usual. 
Exceptions to this rule: If you already expected a named parameter in the query string (See Sample 2 - Compatibility issue when changing from Positional to Named).
Other possible aspects to take care of: 

  • Configuration of rules in the WAF
  • UI Tests that verify the query string of the URL
  • length of the URL (since it is longer now)

 

Run-time/Design-time

This property applies only at design-time.

Samples

Sample 1 - A typical case

Consider  the object 'Client' with this rule

Parm(&Mode,&ClientId);

running on example.com and called by another object with

Client('UPD',1)

will appear in the URL like

  • "http://www.example.com/Client?Mode=UPD&ClientId=1", when using Parameters Styles set to Named, and like
  • "http://www.example.com/Client?UPD,1", when using Parameters Style set to Positional.

Sample 2 - Compatibility issue when changing from Positional to Named

Suppose you have two objects, and one calls the other with a line like the following

MyWebObject(!"Parm1=MyValue")

MyWebObject:  

parm(in:&MyParameter);

source:

&ParameterValueStartPosition =  &MyParameter.IndexOf(!"=");
&ParameterValue = &MyParameter.SubString(&ParameterValueStartPosition+1)
msg(&ParameterValue)

When Parameters Style is Positional, you get the message "MyValue"; whereas with Named parameters, to get "MyValue" again, you need to change the code on the caller to the following:

MyWebObject(!"Parm1%3DMyValue")

How to apply changes

To apply the corresponding changes when the property value is configured, Build any object.

See Also