freemarker.ext.servlet
Class HttpSessionHashModel

java.lang.Object
  extended by freemarker.ext.servlet.HttpSessionHashModel
All Implemented Interfaces:
TemplateHashModel, TemplateModel

public final class HttpSessionHashModel
extends java.lang.Object
implements TemplateHashModel

TemplateHashModel wrapper for HttpSession attributes.

Version:
$Id: HttpSessionHashModel.java 1115 2013-04-12 04:14:28Z run2000 $
Author:
Attila Szegedi, attila@szegedi.org

Constructor Summary
HttpSessionHashModel(javax.servlet.http.HttpSession session)
          Construct a new HttpSessionHashModel.
 
Method Summary
 TemplateModel get(java.lang.String key)
          Retrieve an attribute from the servlet session.
 boolean isEmpty()
          Do we have any attributes in the session?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSessionHashModel

public HttpSessionHashModel(javax.servlet.http.HttpSession session)
Construct a new HttpSessionHashModel.

Parameters:
session - the servlet session to be adapted
Method Detail

get

public TemplateModel get(java.lang.String key)
Retrieve an attribute from the servlet session.

Specified by:
get in interface TemplateHashModel
Parameters:
key - the name of the attribute to be retrieved
Returns:
a TemplateModel wrapping the value we're interested in

isEmpty

public boolean isEmpty()
Do we have any attributes in the session?

Specified by:
isEmpty in interface TemplateModel
Returns:
true if there are no attributes, otherwise false