Class RequestDirective

java.lang.Object
ch.tocco.nice2.optional.cms.impl.directives.RequestDirective
All Implemented Interfaces:
Nice2TemplateDirective, TemplateIdentifiers, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

public class RequestDirective extends Object implements Nice2TemplateDirective, TemplateIdentifiers
This directive provides the current request with url and url parameters. Note: If the url contains a key more than once, you'll receive them comma separated. Usage example: Load the request and save url and parameter 'year' to a variable [@request name="request" /] [#assign currentUrl = request.url] [#assign parameterYear = request.parameters['year']] * Parameters: * name (required): The name of the variable to save the request to.
  • Constructor Details

    • RequestDirective

      public RequestDirective(RequestService requestService)
  • Method Details

    • execute

      public void execute(freemarker.core.Environment env, Map params, freemarker.template.TemplateModel[] templateModels, freemarker.template.TemplateDirectiveBody templateDirectiveBody) throws freemarker.template.TemplateException, IOException
      Specified by:
      execute in interface freemarker.template.TemplateDirectiveModel
      Throws:
      freemarker.template.TemplateException
      IOException