toolbox.web.template
Class HttpServletRequestTm

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

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

Template model for HttpServletRequest.


Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
HttpServletRequestTm()
          Default constructor
HttpServletRequestTm(javax.servlet.http.HttpServletRequest request, freemarker.template.ObjectWrapper wrapper)
          Construct a TemplateModel with the given HttpServletRequest.
 
Method Summary
 freemarker.template.TemplateModel get(java.lang.String name)
          Returns a TemplateModel instance from the member request.
 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

HttpServletRequestTm

public HttpServletRequestTm()
Default constructor


HttpServletRequestTm

public HttpServletRequestTm(javax.servlet.http.HttpServletRequest request,
                            freemarker.template.ObjectWrapper wrapper)
Construct a TemplateModel with the given HttpServletRequest.

Parameters:
request - HTTP request.
wrapper - ObjectWrapper to use.
Method Detail

get

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

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

Specified by:
get in interface freemarker.template.TemplateHashModel
Parameters:
name - Request attribute or parameter name.
Returns:
Value of session attribute as a TemplateModel.
Throws:
freemarker.template.TemplateModelException - if the request attribute or parameter 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