+

Search Tips   |   Advanced Search

The request attribute plug-in

Use the RequestAttribute rendering plug-in to retrieve, set, or remove attributes on the underlying request.

Syntax:

    [Plugin:RequestAttribute key="" value="" defaultValue="" escape=""]

Attributes:

    key
    This attribute is mandatory. Use this attribute to specify the name used to retrieve or set an attribute for the request.

    mode
    Specify the operation to perform:

      get
      Retrieve the specified attribute from the request and return the attribute value.

      set
      Set the specified attribute to the request.

      delete
      Delete the specified attribute from the request.

      remove
      Remove the specified attribute from the request and return the attribute value that was previously set.

    value
    Specify the value of the attribute to be set. If an attribute with the same name exists on the request, that attribute is overwritten with the new value. If we want to set an attribute on the request, this attribute is mandatory.

    defaultValue
    Optional. Use this attribute to specify the value used when an attribute from the request is not defined or has a value of null.

    escape
    Use this attribute to define the escaping to be used for writing the URL. Specify one of the values xml, json, javascript, or none. The default value is none. This value is evaluated only if the mode attribute is set to get or remove.

The RequestAttribute plug-in is available with V8.0.0.1 of Web Content Manager.


Examples

  • To write out the string representation of the request attribute with the name key1, use the following plug-in tag:

      [Plugin:RequestAttribute key="key1"]

  • To write out value1 only when the key1 attribute does not exist on the request or the attribute value is null, use the following plug-in tag. Otherwise, the actual value of the key1 attribute is used.

      [Plugin:RequestAttribute key="key1" defaultValue="value1"]

  • To set the request attribute key1 to the value value1, use the following plug-in tag:
    [Plugin:RequestAttribute key="key1" value="value1"]
    [Plugin:RequestAttribute mode="set" key="key1" value="value1"]

  • To remove the request attribute key1 by passing an empty value attribute, use the following plug-in tag:
    [Plugin:RequestAttribute key="key1" mode="delete"]
    [Plugin:RequestAttribute key="key1" value=""]

  • To remove the attribute with the key key1 from the portlet request, and to return the previously set value, use the following plug-in tag:

      [Plugin:RequestAttribute key="key1" mode="remove"]


Parent Digital data connector rendering plug-ins