Official Content

Determines 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: .NET, .NET Framework, Java
Level: Environment

Description

Parameters are named by default in new Environments. This is to follow common or standard URL writing styles and to simplify 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 shown below:

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

In addition, the order of appearance in the query string is not relevant. The code below:

?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 shown below:

?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.
  • URLs of programs with encrypted parameters are not affected by this property.


Considerations when changing from Positional to Named

When you change this property from Positional to Named, all the code you wrote in GeneXus should keep working as usual. 
This doesn't apply 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 consider: 

  • 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).

 

Runtime/Design time

This property applies only at design time.

Samples

Sample 1 - A typical case

Consider the 'Client' object with this rule:

Parm(&Mode,&ClientId);

It is running on example.com and called by another object with:

Client('UPD',1)

It will appear in the URL as:

  • "http://www.example.com/Client?Mode=UPD&ClientId=1", when using Parameters Styles set to Named, and as:
  • "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 the Parameters Style is Positional, you get the message "MyValue." 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

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant