org.apache.velocity.tools.view
public class WebappUberspector extends AbstractChainableUberspector
This custom uberspector allows getAttribute() and setAttribute() as standard getters and setters for the "request","session" and "application" keys.
It allows VTL statements like:
#set($session.foo = 'youpi') session parameter 'foo' has value: $session.foo
This uberspector requires Velocity 1.6+ ; to use it, you must specify org.apache.velocity.tools.view.WebappUberspector
as the last uberspector to the runtime.introspector.uberspect
property in you velocity.properties
file.
For instance:
runtime.introspector.uberspect = org.apache.velocity.util.introspection.UberspectImpl,org.apache.velocity.tools.view.WebappUberspector
Modifier and Type | Class and Description |
---|---|
class |
WebappUberspector.GetAttributeExecutor
Executor for getAttribute(name) method.
|
class |
WebappUberspector.SetAttributeExecutor
Executor for setAttribute(name,value) method
|
Constructor and Description |
---|
WebappUberspector() |
Modifier and Type | Method and Description |
---|---|
VelPropertyGet |
getPropertyGet(java.lang.Object obj,
java.lang.String identifier,
Info i)
Property getter
|
VelPropertySet |
getPropertySet(java.lang.Object obj,
java.lang.String identifier,
java.lang.Object arg,
Info i)
Property setter
|
void |
init()
init method
|
public VelPropertyGet getPropertyGet(java.lang.Object obj, java.lang.String identifier, Info i) throws java.lang.Exception
obj
- identifier
- i
- java.lang.Exception
public void init()
public VelPropertySet getPropertySet(java.lang.Object obj, java.lang.String identifier, java.lang.Object arg, Info i) throws java.lang.Exception
obj
- identifier
- arg
- i
- java.lang.Exception
Copyright (c) 2003-2007 Apache Software Foundation