freemarker.ext.servlet
Class HttpRequestHashModel

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

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

TemplateHashModel wrapper for HttpServletRequest attributes.

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

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

Constructor Detail

HttpRequestHashModel

public HttpRequestHashModel(javax.servlet.http.HttpServletRequest request)
Construct a new HttpRequestHashModel.

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

get

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

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 request?

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