Class AllHttpScopesHashModel

  • All Implemented Interfaces:
    TemplateHashModel, TemplateHashModelEx, TemplateModel, Serializable

    public class AllHttpScopesHashModel
    extends SimpleHash
    An extension of SimpleHash that looks up keys in the hash, then in the request, session, and servlet context scopes. Makes "Application", "Session" and "Request" keys largely obsolete, however we keep them for backward compatibility (also, "Request" is required for proper operation of JSP taglibs). It is on purpose that we didn't override keys and values methods. That way, only those variables assigned into the hash directly by a subclass of FreemarkerServlet that overrides preTemplateProcess) are discovered as "page" variables by the FM JSP PageContext implementation.
    See Also:
    Serialized Form
    • Constructor Detail

      • AllHttpScopesHashModel

        public AllHttpScopesHashModel​(ObjectWrapper wrapper,
                                      javax.servlet.ServletContext context,
                                      javax.servlet.http.HttpServletRequest request)
        Creates a new instance of AllHttpScopesHashModel for handling a single HTTP servlet request.
        Parameters:
        wrapper - the object wrapper to use
        context - the servlet context of the web application
        request - the HTTP servlet request being processed
    • Method Detail

      • putUnlistedModel

        public void putUnlistedModel​(String key,
                                     TemplateModel model)
        Stores a model in the hash so that it doesn't show up in keys() and values() methods. Used to put the Application, Session, Request, RequestParameters and JspTaglibs objects.
        Parameters:
        key - the key under which the model is stored
        model - the stored model