Package org.apache.velocity.tools.view
Class ViewContextTool
- java.lang.Object
-
- org.apache.velocity.tools.generic.SafeConfig
-
- org.apache.velocity.tools.generic.ContextTool
-
- org.apache.velocity.tools.view.ViewContextTool
-
- Direct Known Subclasses:
ContextTool
public class ViewContextTool extends ContextTool
Extension of
ContextToolthat includes keys and values from theHttpServletRequest,HttpSessionandServletContext.Template example(s): #foreach( $key in $context.keys ) $key = $context.get($key) #end Toolbox configuration: <tools> <toolbox scope="request"> <tool class="org.apache.velocity.tools.view.ViewContextTool"/> </toolbox> </tools>This class is only designed for use as a request-scope VelocityView tool.
- Since:
- VelocityTools 2.0
- Version:
- $Id: ViewContextTool.java 385122 2006-03-11 18:37:42Z nbubna $
- Author:
- Nathan Bubna
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletContextapplicationprotected javax.servlet.http.HttpServletRequestrequestprotected javax.servlet.http.HttpSessionsession-
Fields inherited from class org.apache.velocity.tools.generic.ContextTool
context, toolbox
-
Fields inherited from class org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY
-
-
Constructor Summary
Constructors Constructor Description ViewContextTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(ValueParser parser)Initializes this instance for the current request.protected voidfillKeyset(Set keys)Actually do the work of filling in the set of keys forContextTool.getKeys()here so subclasses can add keys too.-
Methods inherited from class org.apache.velocity.tools.generic.ContextTool
contains, get, getKeys, getThis, getToolbox, getValues
-
Methods inherited from class org.apache.velocity.tools.generic.SafeConfig
configure, isConfigLocked, isSafeMode, setLockConfig, setSafeMode
-
-
-
-
Method Detail
-
configure
protected void configure(ValueParser parser)
Description copied from class:ContextToolInitializes this instance for the current request. Also looks for a safe-mode configuration setting. By default, safeMode is true and thus keys with '.' in them are hidden.- Overrides:
configurein classContextTool
-
fillKeyset
protected void fillKeyset(Set keys)
Description copied from class:ContextToolActually do the work of filling in the set of keys forContextTool.getKeys()here so subclasses can add keys too.- Overrides:
fillKeysetin classContextTool
-
-