org.springframework.web.servlet.view.velocity |
Support classes for the integration of
Velocity
as Spring web view technology.
Contains a View implementation for Velocity templates.
|
Java Source File Name | Type | Comment |
VelocityConfig.java | Interface | Interface to be implemented by objects that configure and manage a
VelocityEngine for automatic lookup in a web environment. |
VelocityConfigurer.java | Class | JavaBean to configure Velocity for web usage, via the "configLocation"
and/or "velocityProperties" and/or "resourceLoaderPath" bean properties.
The simplest way to use this class is to specify just a "resourceLoaderPath";
you do not need any further configuration then.
<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath"><value>/WEB-INF/velocity/</value></property>
</bean>
This bean must be included in the application context of any application
using Spring's VelocityView for web MVC. |
VelocityLayoutView.java | Class | VelocityLayoutView emulates the functionality offered by Velocity's
VelocityLayoutServlet to ease page composition from different templates.
The url property should be set to the content template
for the view, and the layout template location should be specified as
layoutUrl property. |
VelocityLayoutViewResolver.java | Class | Convenience subclass of VelocityViewResolver, adding support
for VelocityLayoutView and its properties. |
VelocityToolboxView.java | Class | 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. |
VelocityView.java | Class | View using the Velocity template engine.
Exposes the following JavaBean properties:
- url: the location of the Velocity template to be wrapped,
relative to the Velocity resource loader path (see VelocityConfigurer).
- encoding (optional, default is determined by Velocity configuration):
the encoding of the Velocity template file
- velocityFormatterAttribute (optional, default=null): the name of
the VelocityFormatter helper object to expose in the Velocity context of this
view, or
null if not needed. |
VelocityViewResolver.java | Class | Convenience subclass of UrlBasedViewResolver that supports VelocityView
(that is Velocity templates) and custom subclasses of it.
The view class for all views generated by this resolver can be specified
via setViewClass . |