|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.util.introspection.UberspectImpl
org.apache.velocity.util.introspection.AbstractChainableUberspector
org.apache.velocity.tools.view.WebappUberspector
public class WebappUberspector
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
Nested Class Summary | |
---|---|
class |
WebappUberspector.GetAttributeExecutor
Executor for getAttribute(name) method. |
class |
WebappUberspector.SetAttributeExecutor
Executor for setAttribute(name,value) method |
Nested classes/interfaces inherited from class org.apache.velocity.util.introspection.UberspectImpl |
---|
UberspectImpl.VelGetterImpl, UberspectImpl.VelMethodImpl, UberspectImpl.VelSetterImpl |
Field Summary |
---|
Fields inherited from class org.apache.velocity.util.introspection.AbstractChainableUberspector |
---|
inner |
Fields inherited from class org.apache.velocity.util.introspection.UberspectImpl |
---|
introspector, log |
Constructor Summary | |
---|---|
WebappUberspector()
|
Method Summary | |
---|---|
VelPropertyGet |
getPropertyGet(Object obj,
String identifier,
Info i)
Property getter |
VelPropertySet |
getPropertySet(Object obj,
String identifier,
Object arg,
Info i)
Property setter |
void |
init()
init method |
Methods inherited from class org.apache.velocity.util.introspection.AbstractChainableUberspector |
---|
getIterator, getMethod, wrap |
Methods inherited from class org.apache.velocity.util.introspection.UberspectImpl |
---|
setLog, setRuntimeLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebappUberspector()
Method Detail |
---|
public VelPropertyGet getPropertyGet(Object obj, String identifier, Info i) throws Exception
getPropertyGet
in interface Uberspect
getPropertyGet
in class AbstractChainableUberspector
obj
- identifier
- i
-
Exception
public void init()
init
in interface Uberspect
init
in class AbstractChainableUberspector
public VelPropertySet getPropertySet(Object obj, String identifier, Object arg, Info i) throws Exception
getPropertySet
in interface Uberspect
getPropertySet
in class AbstractChainableUberspector
obj
- identifier
- arg
- i
-
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |