Class HttpRequestHashModel

java.lang.Object
org.craftercms.engine.util.freemarker.HttpRequestHashModel
All Implemented Interfaces:
freemarker.template.TemplateHashModel, freemarker.template.TemplateHashModelEx, freemarker.template.TemplateModel

public class HttpRequestHashModel extends Object implements freemarker.template.TemplateHashModelEx
Just like HttpRequestHashModel, but besides returning request attributes, it also returns values for the following properties of the request:
  • scheme
  • serverName
  • serverPort
  • contextPath
  • servletPath
  • requestURI
  • queryString
Author:
avasquez
  • Field Details

  • Constructor Details

    • HttpRequestHashModel

      public HttpRequestHashModel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, freemarker.template.ObjectWrapper wrapper, boolean disableRestrictions)
  • Method Details

    • get

      public freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException
      Specified by:
      get in interface freemarker.template.TemplateHashModel
      Throws:
      freemarker.template.TemplateModelException
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface freemarker.template.TemplateHashModel
    • size

      public int size()
      Specified by:
      size in interface freemarker.template.TemplateHashModelEx
    • keys

      public freemarker.template.TemplateCollectionModel keys()
      Specified by:
      keys in interface freemarker.template.TemplateHashModelEx
    • values

      public freemarker.template.TemplateCollectionModel values()
      Specified by:
      values in interface freemarker.template.TemplateHashModelEx
    • getRequest

      public javax.servlet.http.HttpServletRequest getRequest()
    • getResponse

      public javax.servlet.http.HttpServletResponse getResponse()
    • getObjectWrapper

      public freemarker.template.ObjectWrapper getObjectWrapper()