freemarker.ext.servlet
Class HttpRequestParametersHashModel

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

public class HttpRequestParametersHashModel
extends java.lang.Object
implements TemplateHashModel

TemplateHashModel wrapper for HttpServletRequest parameters.

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

Constructor Summary
HttpRequestParametersHashModel(javax.servlet.http.HttpServletRequest request)
          Construct a new HttpRequestParameterHashModel.
 
Method Summary
 TemplateModel get(java.lang.String key)
          Retrieve a TemplateModel corresponding to the given request variable
 boolean isEmpty()
          Do we have any items in the request?
protected  java.lang.String transcode(java.lang.String string)
          A hook for allowing Strings to be transformed before being passed into the TemplateModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequestParametersHashModel

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

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

get

public TemplateModel get(java.lang.String key)
Retrieve a TemplateModel corresponding to the given request variable

Specified by:
get in interface TemplateHashModel
Parameters:
key - the name of the request variable to be returned
Returns:
a TemplateModel of any occurrences of the variable in the request.

isEmpty

public boolean isEmpty()
Do we have any items in the request?

Specified by:
isEmpty in interface TemplateModel
Returns:
true if the request is empty, otherwise false

transcode

protected java.lang.String transcode(java.lang.String string)
A hook for allowing Strings to be transformed before being passed into the TemplateModel.

Parameters:
string - the String to be transcoded
Returns:
the transcoded String