freemarker.ext.servlet
Class HttpSessionHashModel
java.lang.Object
freemarker.ext.servlet.HttpSessionHashModel
- All Implemented Interfaces:
- TemplateHashModel, TemplateModel, java.io.Serializable
public final class HttpSessionHashModel
- extends java.lang.Object
- implements TemplateHashModel, java.io.Serializable
TemplateHashModel wrapper for a HttpSession attributes.
- Version:
- $Id: HttpSessionHashModel.java,v 1.14.4.1 2006/04/19 16:16:43 szegedia Exp $
- Author:
- Attila Szegedi
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpSessionHashModel
public HttpSessionHashModel(javax.servlet.http.HttpSession session,
ObjectWrapper wrapper)
- Use this constructor when the session already exists.
- Parameters:
session
- the sessionwrapper
- an object wrapper used to wrap session attributes
HttpSessionHashModel
public HttpSessionHashModel(FreemarkerServlet servlet,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ObjectWrapper wrapper)
- Use this constructor when the session isn't already created. It is passed
enough parameters so that the session can be properly initialized after
it is detected that it was created.
- Parameters:
servlet
- the FreemarkerServlet that created this model. If the
model is not created through FreemarkerServlet, leave this argument as
null.request
- the actual requestresponse
- the actual responsewrapper
- an object wrapper used to wrap session attributes
get
public TemplateModel get(java.lang.String key)
throws TemplateModelException
- Description copied from interface:
TemplateHashModel
- Gets a TemplateModel from the hash.
- Specified by:
get
in interface TemplateHashModel
- Parameters:
key
- the name by which the TemplateModel
is identified in the template.
- Returns:
- the TemplateModel referred to by the key,
or null if not found.
- Throws:
TemplateModelException
isEmpty
public boolean isEmpty()
throws TemplateModelException
- Specified by:
isEmpty
in interface TemplateHashModel
- Throws:
TemplateModelException