public class ViewContextTool extends ContextTool
Extension of ContextTool that includes keys and values
from the HttpServletRequest, HttpSession and
ServletContext.
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.
| Modifier and Type | Field and Description |
|---|---|
protected ServletContext |
application |
protected HttpServletRequest |
request |
protected HttpSession |
session |
context, toolboxLOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY| Constructor and Description |
|---|
ViewContextTool() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure(ValueParser parser)
Initializes this instance for the current request.
|
protected void |
fillKeyset(java.util.Set keys)
Actually do the work of filling in the set of keys
for
ContextTool.getKeys() here so subclasses can add keys too. |
contains, get, getKeys, getThis, getToolbox, getValuesconfigure, isConfigLocked, isSafeMode, setLockConfig, setSafeModeprotected HttpServletRequest request
protected HttpSession session
protected ServletContext application
protected void configure(ValueParser parser)
ContextToolconfigure in class ContextToolprotected void fillKeyset(java.util.Set keys)
ContextToolContextTool.getKeys() here so subclasses can add keys too.fillKeyset in class ContextToolCopyright (c) 2003-2007 Apache Software Foundation