You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Apache Wiki <wi...@apache.org> on 2007/10/26 23:31:02 UTC

[Velocity Wiki] Update of "VelocityTools2" by NathanBubna

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Velocity Wiki" for change notification.

The following page has been changed by NathanBubna:
http://wiki.apache.org/velocity/VelocityTools2

The comment on the change is:
start importing rough drafts of veltools2 docs

New page:
== Table of Contents ==
 1. [#Overview Overview]
 2. [wiki:/Config  Configuration]
  * [wiki:/ConfigXml XML]
  * [wiki:/ConfigProperties Properties]
  * [wiki:/ConfigJava Java]
 3. [wiki:/StandaloneUse "Standalone" Use]
 4. [wiki:/GenericTools GenericTools]
 5. [wiki:/VelocityView VelocityView]
 6. [wiki:/VelocityStruts VelocityStruts]
 7. [wiki:/WebFrameworkIntegration Integration w/a Web Framework]
 8. [wiki:/CreatingTools Creating Your Own Tools]

== Overview ==

A Velocity "tool" is just a POJO (plain old java object) that is "useful" in a template and is not meant to be rendered in the output.  In other words, a "tool" (in Velocity-speak) is meant to be used but not seen themselves (e.g. for formatting dates or numbers, url building, etc).

The VelocityTools project is, first of all, a collection of such useful Java classes, as well as infrastructure to easily, automatically and transparently make these tools available to your Velocity templates.  Other aims of the project include providing easy integration of Velocity into the view-layer of your web applications (via the VelocityViewTag and VelocityViewServlet) and integration with Struts 1.x applications.

In recognition of these varying aims, the VelocityTools project is divided into three parts:  [wiki:/GenericTools GenericTools], [wiki:/VelocityView VelocityView] and [wiki:/VelocityStruts VelocityStruts].  Each of these parts builds on the previous one and has its own JAR distribution.

[wiki:/GenericTools GenericTools] is the set of classes that provide basic infrastructure for using tools in standard Java SE Velocity projects, as well as a set of tools for use in generic Velocity templates.  Perenial favorites here are the DateTool, NumberTool and RenderTool, though there are many others available as well.

[wiki:/VelocityView VelocityView] includes all of the [wiki:/GenericTools GenericTools] and adds infrastructure and specialized tools for using Velocity in the view layer of web applications (Java EE projects).  This includes the VelocityViewServlet or VelocityLayoutServlet for processing Velocity template requests and the VelocityViewTag for embedding Velocity in JSP.  Popular tools here are the LinkTool and the ParameterTool.

[wiki:/VelocityStruts VelocityStruts] includes both [wiki:/VelocityView VelocityView] and [wiki:/GenericTools GenericTools] and adds tools for use in Struts 1.x applications.  These tools match the functions of the key Struts taglibs and provide access to Struts resources, messages, tiles, validation functions and more.

It is worth noting that these tools, being POJOs (though some require a little configuration) are generally useful and may be used within your java classes or even other template languages, though you may need to instantiate and configure them manually (not difficult) to do so.  VelocityTools2 has been designed with this in mind.  Ask on the user mailing list if you have questions about using VelocityTools without Velocity.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org