freemarker.ext.servlet

Class AllHttpScopesHashModel

Implemented Interfaces:
Serializable, TemplateHashModel, TemplateHashModelEx, TemplateModel

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.
Version:
$Id: AllHttpScopesHashModel.java,v 1.5.4.1 2006/04/26 12:22:07 szegedia Exp $
Author:
Attila Szegedi

Fields inherited from interface freemarker.template.TemplateModel

NOTHING

Method Summary

TemplateModel
get(String key)
void
putUnlistedModel(String key, TemplateModel model)
Stores a model in the hash so that it doesn't show up in keys() and values() methods.

Methods inherited from class freemarker.template.SimpleHash

copyMap, get, isEmpty, keys, put, put, putAll, remove, size, synchronizedWrapper, toMap, toString, values

Methods inherited from class freemarker.template.WrappingTemplateModel

getDefaultObjectWrapper, getObjectWrapper, setDefaultObjectWrapper, setObjectWrapper, wrap

Method Details

get

public TemplateModel get(String key)
            throws TemplateModelException
Specified by:
get in interface TemplateHashModel
Overrides:
get in interface SimpleHash

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