类 VelocityToolboxView

  • 所有已实现的接口:
    Aware, BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
    直接已知子类:
    VelocityLayoutView

    @Deprecated
    public class VelocityToolboxView
    extends VelocityView
    已过时。
    as of Spring 4.3, in favor of FreeMarker
    VelocityView subclass which adds support for Velocity Tools toolboxes and Velocity Tools ViewTool callbacks / Velocity Tools 1.3 init methods.

    Specify a "toolboxConfigLocation", for example "/WEB-INF/toolbox.xml", to automatically load a Velocity Tools toolbox definition file and expose all defined tools in the specified scopes. If no config location is specified, no toolbox will be loaded and exposed.

    This view will always create a special Velocity context, namely an instance of the ChainedContext class which is part of the view package of Velocity tools. This allows to use tools from the view package of Velocity Tools, like LinkTool, which need to be initialized with a special context that implements the ViewContext interface (i.e. a ChainedContext).

    This view also checks tools that are specified as "toolAttributes": If they implement the ViewTool interface, they will get initialized with the Velocity context. This allows tools from the view package of Velocity Tools, such as LinkTool, to be defined as "toolAttributes" on a VelocityToolboxView, instead of in a separate toolbox XML file.

    This is a separate class mainly to avoid a required dependency on the view package of Velocity Tools in VelocityView itself. As of Spring 3.0, this class requires Velocity Tools 1.3 or higher.

    从以下版本开始:
    1.1.3
    作者:
    Juergen Hoeller
    另请参阅:
    setToolboxConfigLocation(java.lang.String), initTool(java.lang.Object, org.apache.velocity.context.Context), ViewContext, ChainedContext