toolbox.web.template
Class HttpSessionTm

Package class diagram package HttpSessionTm
java.lang.Object
  extended by toolbox.web.template.HttpSessionTm
All Implemented Interfaces:
freemarker.template.TemplateHashModel, freemarker.template.TemplateModel

public class HttpSessionTm
extends java.lang.Object
implements freemarker.template.TemplateHashModel

Template model for HttpSession.


Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
HttpSessionTm()
          Default constructor
HttpSessionTm(javax.servlet.http.HttpSession session, freemarker.template.ObjectWrapper wrapper)
          Construct a TemplateModel with the given HttpSession.
 
Method Summary
 freemarker.template.TemplateModel get(java.lang.String name)
          Returns a TemplateModel instance from the member session.
 boolean isEmpty()
          Check to see if member session has any attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSessionTm

public HttpSessionTm()
Default constructor


HttpSessionTm

public HttpSessionTm(javax.servlet.http.HttpSession session,
                     freemarker.template.ObjectWrapper wrapper)
Construct a TemplateModel with the given HttpSession.

Parameters:
session - HTTP session.
wrapper - ObjectWrapper
Method Detail

get

public freemarker.template.TemplateModel get(java.lang.String name)
                                      throws freemarker.template.TemplateModelException
Returns a TemplateModel instance from the member session.

This method will attempt to wrap the value of the named session attribute in a suitable TemplateModel.

Specified by:
get in interface freemarker.template.TemplateHashModel
Parameters:
name - Session attribute name.
Returns:
Value of session attribute as a TemplateModel.
Throws:
freemarker.template.TemplateModelException - if the session cannot be wrapped.

isEmpty

public boolean isEmpty()
                throws freemarker.template.TemplateModelException
Check to see if member session has any attributes.

Specified by:
isEmpty in interface freemarker.template.TemplateHashModel
Returns:
boolean indicating whether this model is empty.
Throws:
freemarker.template.TemplateModelException