Class Summary |
MultiViewsTool
|
Allows for transparent content negotiation in a manner mimicking
Apache httpd's MultiViews.Reads the default language out of the ViewContext as
org.apache.velocity.tools.view.i18n.defaultLanguage.
See {@link #findLocalizedResource(String, String)} and {@link
#findLocalizedResource(String, Locale)} for usage. |
ServletToolboxManager
|
|
ServletToolInfo
|
ToolInfo implementation that holds scope information for tools
used in a servlet environment.
|
ViewToolInfo
|
ToolInfo implementation for view tools. New instances
are returned for every call to getInstance(obj), and tools
that implement (@link ViewTool} are initialized with the
given object before being returned.
|
XMLToolboxManager
|
A ToolboxManager for loading a toolbox from xml.
A toolbox manager is responsible for automatically filling the Velocity
context with a set of view tools. This class provides the following
features:configurable through an XML-based configuration fileassembles a set of view tools (the toolbox) on requestsupports any class with a public constructor without parameters
to be used as a view toolsupports adding primitive data values to the context(String,Number,Boolean)ConfigurationThe toolbox manager is configured through an XML-based configuration
file. The configuration file is passed to the {@link #load(java.io.InputStream input)}
method. The required format is shown in the following example:
<?xml version="1.0"?>
<toolbox>
<tool>
<key>toolLoader</key>
<class>org.apache.velocity.tools.tools.ToolLoader</class>
</tool>
<tool>
<key>math</key>
<class>org.apache.velocity.tools.tools.MathTool</class>
</tool>
<data type="Number">
<key>luckynumber</key>
<value>1.37</class>
</data>
<data type="String">
<key>greeting</key>
<value>Hello World!</class>
</data>
</toolbox>
|