getHttpParam

getHttpParam(paramName: String): String;

The getHttpParam method of the WebSession class, which returns the value associated with the HyperText Transfer Protocol (HTTP) parameter specified in the paramName parameter, can be reimplemented in your user session class.

The HTTP string that is returned from the web browser generally constitutes name-value pairs. The name-value pairs are separated by an ampersand character (&) and within this, the name and value are separated by an equals symbol (=).

Use this method to get the value portion of a name-value pair, as shown in the following example.

getUserName(): String;
vars
    userName: String;
begin
    //look for a field name called userName
    userName := currentSession.getHttpParam('userName');
    return userName;
end;

The paramName parameter is case-sensitive.

Using the http://www.jadeworld.com/jadehttp.dll?TestApp&myparam=KiaOra HTTP string, the code fragment in the following example shows the use of the getHttpParam method to return the specified value.

str := currentSession.getHttpParam("myparam");
write str;           // Outputs "KiaOra"

If the specified parameter does not exist, a null string ("") is returned.