public class ScopesHashModel
extends freemarker.template.SimpleHash
implements freemarker.template.TemplateModel
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
Updated to subclass AllHttpScopesHashModel.java to incorporate invisible scopes and compatibility with freemarker.
Constructor and Description |
---|
ScopesHashModel(freemarker.template.ObjectWrapper objectWrapper,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request) |
ScopesHashModel(freemarker.template.ObjectWrapper objectWrapper,
javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
ValueStack stack) |
Modifier and Type | Method and Description |
---|---|
freemarker.template.TemplateModel |
get(String key) |
void |
put(String string,
boolean b) |
void |
put(String string,
Object object) |
void |
putUnlistedModel(String key,
freemarker.template.TemplateModel model)
Stores a model in the hash so that it doesn't show up in keys()
and values() methods.
|
containsKey, copyMap, isEmpty, keys, keyValuePairIterator, putAll, remove, size, synchronizedWrapper, toMap, toString, values
public ScopesHashModel(freemarker.template.ObjectWrapper objectWrapper, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, ValueStack stack)
public ScopesHashModel(freemarker.template.ObjectWrapper objectWrapper, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request)
public void putUnlistedModel(String key, freemarker.template.TemplateModel model)
key
- the key under which the model is storedmodel
- the stored modelpublic freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException
get
in interface freemarker.template.TemplateHashModel
get
in class freemarker.template.SimpleHash
freemarker.template.TemplateModelException
public void put(String string, boolean b)
put
in class freemarker.template.SimpleHash
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.