org.apache.struts2.views.freemarker
Class ScopesHashModel

java.lang.Object
  extended by freemarker.template.WrappingTemplateModel
      extended by freemarker.template.SimpleHash
          extended by org.apache.struts2.views.freemarker.ScopesHashModel
All Implemented Interfaces:
freemarker.template.TemplateHashModel, freemarker.template.TemplateHashModelEx, freemarker.template.TemplateModel, Serializable

public class ScopesHashModel
extends freemarker.template.SimpleHash

Simple Hash model that also searches other scopes.

If the key doesn't exist in this hash, this template model tries to resolve the key within the attributes of the following scopes, in the order stated: Request, Session, Servlet Context

See Also:
Serialized Form

Field Summary
private  HttpServletRequest request
           
private static long serialVersionUID
           
private  ServletContext servletContext
           
private  ValueStack stack
           
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
ScopesHashModel(freemarker.template.ObjectWrapper objectWrapper, ServletContext context, HttpServletRequest request, ValueStack stack)
           
 
Method Summary
 freemarker.template.TemplateModel get(String key)
           
 void put(String string, boolean b)
           
 void put(String string, Object object)
           
 
Methods inherited from class freemarker.template.SimpleHash
copyMap, isEmpty, keys, putAll, remove, size, synchronizedWrapper, toMap, toString, values
 
Methods inherited from class freemarker.template.WrappingTemplateModel
getDefaultObjectWrapper, getObjectWrapper, setDefaultObjectWrapper, setObjectWrapper, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

request

private HttpServletRequest request

servletContext

private ServletContext servletContext

stack

private ValueStack stack
Constructor Detail

ScopesHashModel

public ScopesHashModel(freemarker.template.ObjectWrapper objectWrapper,
                       ServletContext context,
                       HttpServletRequest request,
                       ValueStack stack)
Method Detail

get

public freemarker.template.TemplateModel get(String key)
                                      throws freemarker.template.TemplateModelException
Specified by:
get in interface freemarker.template.TemplateHashModel
Overrides:
get in class freemarker.template.SimpleHash
Throws:
freemarker.template.TemplateModelException

put

public void put(String string,
                boolean b)
Overrides:
put in class freemarker.template.SimpleHash

put

public void put(String string,
                Object object)
Overrides:
put in class freemarker.template.SimpleHash


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.