freemarker.ext.servlet

Class HttpSessionHashModel

Implemented Interfaces:
Serializable, TemplateHashModel, TemplateModel

public final class HttpSessionHashModel
extends java.lang.Object
implements TemplateHashModel, 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

Fields inherited from interface freemarker.template.TemplateModel

NOTHING

Constructor Summary

HttpSessionHashModel(HttpSession session, ObjectWrapper wrapper)
Use this constructor when the session already exists.
HttpSessionHashModel(FreemarkerServlet servlet, HttpServletRequest request, HttpServletResponse response, ObjectWrapper wrapper)
Use this constructor when the session isn't already created.

Method Summary

TemplateModel
get(String key)
boolean
isEmpty()

Constructor Details

HttpSessionHashModel

public HttpSessionHashModel(HttpSession session,
                            ObjectWrapper wrapper)
Use this constructor when the session already exists.
Parameters:
session - the session
wrapper - an object wrapper used to wrap session attributes

HttpSessionHashModel

public HttpSessionHashModel(FreemarkerServlet servlet,
                            HttpServletRequest request,
                            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 request
response - the actual response
wrapper - an object wrapper used to wrap session attributes

Method Details

get

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

isEmpty

public boolean isEmpty()
            throws TemplateModelException
Specified by:
isEmpty in interface TemplateHashModel