The request object

The request object represents an http request.


param

Returns the request parameters.

Syntax:

param → hash model

Returns:

The request parameters.

Example:

This code loops through all the request parameters:

<#list request.param as param>

Accessing the value of a specific parameter can be done in two ways:

<p>The value of parameter "helloworld" is ${request.param.helloworld}, 
but it is also ${request.param["helloworld"]}.</p>

Which will output something like:

The value of parameter "helloworld" is Hello World!, but it is also Hello World!.


path

Returns the request path.

Syntax:

path → string

Returns:

The request path.

Example:

This code gets the request path and assigns it to a variable:

<#assign path = request.path>

site

Returns the site path.

Syntax:

site → string

Returns:

The site path.

Example:

This code gets the site path and assigns it to a variable:

<#assign site = request.site>

url

Returns the complete request url.

Syntax:

url → string

Returns:

The complete request url. It will not include request parameters or similar.

Example:

This code gets the request url and assigns it to a variable:

<#assign url = request.url>