The Velocity Template Engine allows the Velocity Template Language to be used within a JSP using JSP custom tags. Velocity is a general templating tool that provides a simple template language that allows easy access to java objects, methods, and data.
By allowing the use of Velocity from within a JSP, it allows a JSP author easy access to all public methods exposed by a Java class, as well as a simple set of control and logical directives.
This custom tag library requires no software other than a servlet container that supports the JavaServer Pages Specification, version 1.1 or higher, and the Jakarta Velocity Template Engine, version 1.1 or higher.
Building the library is fairly straightforward. What to do :
Follow these steps to configure your web application with this tag library:
<taglib> <taglib-uri>http://jakarta.apache.org/taglibs/veltag-0.01</taglib-uri> <taglib-location>/WEB-INF/veltag.tld</taglib-location> </taglib>
To use the tags from this library in your JSP pages, add the following directive at the top of each page:
<%@ taglib uri="/WEB-INF/veltag.tld" prefix="vel" %>
where "vel" is the tag name prefix you wish to use for tags from this library. You can change this value to any prefix you like.
velocity | Processes the body as VTL. The body of the tag consists of normal Velocity template content. This content is a free mixture of VTL (Velocity Template Language) references and directives, as well as non-VTL content which is called 'schmoo'. |
|
|||||||||||||||||||||
Processes the body as VTL. The body of the tag consists of normal Velocity template content. This content is a free mixture of VTL (Velocity Template Language) references and directives, as well as non-VTL content which is called 'schmoo'. | |||||||||||||||||||||
|
See the example template in the distrubution /examples directory
To create the javadocs, use the 'javadoc' build target. The docs will be here.
v0.01