类 WebappUberspector

java.lang.Object
org.apache.velocity.util.introspection.UberspectImpl
org.apache.velocity.util.introspection.AbstractChainableUberspector
org.apache.velocity.tools.view.WebappUberspector
所有已实现的接口:
org.apache.velocity.util.introspection.ChainableUberspector, org.apache.velocity.util.introspection.Uberspect, org.apache.velocity.util.RuntimeServicesAware

public class WebappUberspector extends org.apache.velocity.util.introspection.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

版本:
$Id: WebappUberspector.java $
作者:
Claude Brisson
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    class 
    Executor for getAttribute(name) method.
    class 
    Executor for setAttribute(name,value) method

    从类继承的嵌套类/接口 org.apache.velocity.util.introspection.UberspectImpl

    org.apache.velocity.util.introspection.UberspectImpl.VelGetterImpl, org.apache.velocity.util.introspection.UberspectImpl.VelMethodImpl, org.apache.velocity.util.introspection.UberspectImpl.VelSetterImpl
  • 字段概要

    从类继承的字段 org.apache.velocity.util.introspection.AbstractChainableUberspector

    inner

    从类继承的字段 org.apache.velocity.util.introspection.UberspectImpl

    conversionHandler, introspector, log, rsvc
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    org.apache.velocity.util.introspection.VelPropertyGet
    getPropertyGet(Object obj, String identifier, org.apache.velocity.util.introspection.Info i)
    Property getter
    org.apache.velocity.util.introspection.VelPropertySet
    getPropertySet(Object obj, String identifier, Object arg, org.apache.velocity.util.introspection.Info i)
    Property setter
    void
    init method

    从类继承的方法 org.apache.velocity.util.introspection.AbstractChainableUberspector

    getIterator, getMethod, wrap

    从类继承的方法 org.apache.velocity.util.introspection.UberspectImpl

    getConversionHandler, setLog, setRuntimeServices

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • WebappUberspector

      public WebappUberspector()
  • 方法详细资料

    • getPropertyGet

      public org.apache.velocity.util.introspection.VelPropertyGet getPropertyGet(Object obj, String identifier, org.apache.velocity.util.introspection.Info i)
      Property getter
      指定者:
      getPropertyGet 在接口中 org.apache.velocity.util.introspection.Uberspect
      覆盖:
      getPropertyGet 在类中 org.apache.velocity.util.introspection.AbstractChainableUberspector
      参数:
      obj - target object
      identifier - property key
      i - tool info
      返回:
      A Velocity Getter Method.
    • init

      public void init()
      init method
      指定者:
      init 在接口中 org.apache.velocity.util.introspection.Uberspect
      覆盖:
      init 在类中 org.apache.velocity.util.introspection.AbstractChainableUberspector
    • getPropertySet

      public org.apache.velocity.util.introspection.VelPropertySet getPropertySet(Object obj, String identifier, Object arg, org.apache.velocity.util.introspection.Info i)
      Property setter
      指定者:
      getPropertySet 在接口中 org.apache.velocity.util.introspection.Uberspect
      覆盖:
      getPropertySet 在类中 org.apache.velocity.util.introspection.AbstractChainableUberspector
      参数:
      obj - target object
      identifier - property key
      arg - value to set
      i - tool info
      返回:
      A Velocity Setter method.