<commit_before><HTML><HEAD><TITLE>Developer's Guide</TITLE></HEAD><BODY alink="#023264" bgcolor="#ffffff" leftmargin="4" link="#023264" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#023264"><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD align="left" valign="top"><A href="http://jakarta.apache.org/index.html"><IMG border="0" hspace="0" src="resources/jakarta-logo.gif" vspace="0"></A></TD><TD align="left" bgcolor="#ffffff" valign="top" width="100%"><IMG align="right" alt="" border="0" hspace="0" src="resources/header.gif" vspace="0"></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"></TD></TR><TR><TD background="resources/line.gif" colspan="2" height="2" width="100%"><IMG alt="" border="0" height="2" hspace="0" src="resources/line.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD valign="top" width="1%"></TD><TD nowrap="1" valign="top" width="14%"><BR>

<P>About</P>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="index.html">Overview</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="getting-started.html">Getting Started</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="install.html">Install</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="design.html">Design</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="contributors.html">Contributors</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="code-standards.html">Coding Standards</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="license.html">License</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="todo.html">TODO</A></LI></FONT>
<P>Guides</P>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="user-guide.html">User's Guide</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="developer-guide.html">Developer's Guide</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="vtl-reference-guide.html">VTL Reference Guide</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="differences.html">VM/WM Differences</A></LI></FONT>
<P>Tools</P>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="anakia.html">Anakia</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="texen.html">Texen</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="migration.html">Migration To Velocity</A></LI></FONT>
</TD><TD align="left" valign="top" width="*"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD><BR>

 



<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD bgcolor="#023264" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Introduction</B></FONT></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">
Velocity is a Java-based template engine, a simple and powerful development tool that allows you to easily create and render
documents that format and present your data.
In this guide, we hope to give an overview of the basics of development using Velocity, focusing on the two main areas for Velocity usage :

<BLOCKQUOTE><UL>
<LI> servlet-based WWW development</LI>
<LI> general application use</LI>
</UL></BLOCKQUOTE>

You will see that there is no real difference between these, other than we make servlet development with Velocity very easy
if you use our provided class VelocityServlet as a base class for your servlet, and offer a utility class to help with application
development.
</P>
<B>Getting Started</B>
<P align="justify">
While this information is found elsewhere on the Velocity site and in the documentation, it is included here for completeness.  Getting 
Velocity running on your computer is very easy.  Note that all directory references are relative the root of the Velocity
distribution tree.
<BLOCKQUOTE><OL>
<LI> Get the Velocity distribution.  This is available as a nightly snapshot or directly from the CVS code repository.  Either way is fine.  For more information, go <A href="index.html">here</A>.</LI>
<LI> Go to the <CODE><FONT face="courier, monospaced">build</FONT></CODE> directory in the distribution.</LI>
<LI> Type <CODE><FONT face="courier, monospaced">./build-velocity.sh jar</FONT></CODE> under Unix, or <CODE><FONT face="courier, monospaced">build-velocity.bat jar</FONT></CODE> under Windows.  The major build targets are :
<BLOCKQUOTE><UL>
<LI> <CODE><FONT face="courier, monospaced">jar</FONT></CODE> builds the complete Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory.  This jar will be called 'velocity-X.jar', where 'X' is the current version number.  Unless you have specific storage space considerations, use this jar for convenience, as it includes everything you need.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-core</FONT></CODE> builds a slimmer Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-core-X.jar'. This
jar contains the core Velocity functionality, and doesn't include example and utility things like Anakia, Texen or 
the VelocityServlet support baseclass.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-util</FONT></CODE> builds a utility Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-util-X.jar'. This
jar contains utility code, specifically Anakia, Texen, and the WebMacro template conversion utility.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-servlet</FONT></CODE> builds a utility Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-servlet-X.jar'. This
jar contains utility code for servlet programmers.</LI>
<LI> <CODE><FONT face="courier, monospaced">examples</FONT></CODE> builds the example code in the example programs found in the <CODE><FONT face="courier, monospaced">examples</FONT></CODE> directory. 
This build target will also build the forumdemo example project.</LI>
<LI> <CODE><FONT face="courier, monospaced">forumdemo</FONT></CODE> builds the example webapplication in the <CODE><FONT face="courier, monospaced">examples/forumdemo</FONT></CODE> directory.</LI>
<LI> <CODE><FONT face="courier, monospaced">docs</FONT></CODE> builds these docs in the <CODE><FONT face="courier, monospaced">docs</FONT></CODE> directory</LI>
<LI> <CODE><FONT face="courier, monospaced">javadocs</FONT></CODE> builds the Javadoc class documentation in the <CODE><FONT face="courier, monospaced">docs/apidocs</FONT></CODE> directory</LI>
<LI> <CODE><FONT face="courier, monospaced">test</FONT></CODE> (after jar) will test Velocity against it's testbed suite of test routines </LI>
</UL></BLOCKQUOTE></LI>
<LI> While not required, testing the build is a good idea.  Use the <CODE><FONT face="courier, monospaced">test</FONT></CODE> target mentioned above.</LI>
<LI> That's it!  Velocity is ready to be used.  Put the jar into your classpath, or into other appropriate places (such as the lib directory of your webapp if using with servlets)</LI>
<LI> If you want to play with the examples, which is highly recommended when getting started, use build the examples via 
<CODE><FONT face="courier, monospaced">./build-velocity.sh examples</FONT></CODE> or <CODE><FONT face="courier, monospaced">build-velocity.bat examples</FONT></CODE>.</LI>
</OL></BLOCKQUOTE>
</P>
</FONT></TD></TR></TABLE></DIV><BR>

<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD bgcolor="#023264" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Resources</B></FONT></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">
There are quite a few resources and examples available to the programmer, and we recommend that you look at our examples, documentation and even the source code.  Some great sources are :

<BLOCKQUOTE><UL>
<LI> source code : <CODE><FONT face="courier, monospaced">src/java/...</FONT></CODE> : all the source code to the Velocity project</LI>
<LI> application example 1 : <CODE><FONT face="courier, monospaced">examples/app_example1</FONT></CODE> : a simple example showing how to use Velocity in an application
program. </LI>
<LI> application example 2 : <CODE><FONT face="courier, monospaced">examples/app_example2</FONT></CODE> : a simple example showing how to use Velocity in an application
program using the Velocity application utility class. </LI>
<LI> servlet example : <CODE><FONT face="courier, monospaced">examples/servlet_example1</FONT></CODE> : a simple example showing how to use Velocity in a servlet. </LI>
<LI> Anakia application : <CODE><FONT face="courier, monospaced">examples/anakia</FONT></CODE> :  example application showing how to use Velocity for creating 
stylesheet renderings of xml data </LI><commit_msg>follows the xml PR: Obtained from: Submitted by: Reviewed by:<commit_after><HTML><HEAD><TITLE>Developer's Guide</TITLE></HEAD><BODY alink="#023264" bgcolor="#ffffff" leftmargin="4" link="#023264" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#023264"><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD align="left" valign="top"><A href="http://jakarta.apache.org/index.html"><IMG border="0" hspace="0" src="resources/jakarta-logo.gif" vspace="0"></A></TD><TD align="left" bgcolor="#ffffff" valign="top" width="100%"><IMG align="right" alt="" border="0" hspace="0" src="resources/header.gif" vspace="0"></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"></TD></TR><TR><TD background="resources/line.gif" colspan="2" height="2" width="100%"><IMG alt="" border="0" height="2" hspace="0" src="resources/line.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD valign="top" width="1%"></TD><TD nowrap="1" valign="top" width="14%"><BR>

<P>About</P>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="index.html">Overview</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="getting-started.html">Getting Started</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="install.html">Install</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="design.html">Design</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="contributors.html">Contributors</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="code-standards.html">Coding Standards</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="license.html">License</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="todo.html">TODO</A></LI></FONT>
<P>Guides</P>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="user-guide.html">User's Guide</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="developer-guide.html">Developer's Guide</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="vtl-reference-guide.html">VTL Reference Guide</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="differences.html">VM/WM Differences</A></LI></FONT>
<P>Tools</P>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="anakia.html">Anakia</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="texen.html">Texen</A></LI></FONT>
    <FONT face="arial,helvetica,sanserif" size="-1"><LI><A href="migration.html">Migration To Velocity</A></LI></FONT>
</TD><TD align="left" valign="top" width="*"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD><BR>

 



<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD bgcolor="#023264" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Introduction</B></FONT></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">
Velocity is a Java-based template engine, a simple and powerful development tool that allows you to easily create and render
documents that format and present your data.
In this guide, we hope to give an overview of the basics of development using Velocity, focusing on the two main areas for Velocity usage :

<BLOCKQUOTE><UL>
<LI> servlet-based WWW development</LI>
<LI> general application use</LI>
</UL></BLOCKQUOTE>

You will see that there is no real difference between these, other than we make servlet development with Velocity very easy
if you use our provided class VelocityServlet as a base class for your servlet, and offer a utility class to help with application
development.
</P>
<B>Getting Started</B>
<P align="justify">
While this information is found elsewhere on the Velocity site and in the documentation, it is included here for completeness.  Getting 
Velocity running on your computer is very easy.  Note that all directory references are relative the root of the Velocity
distribution tree.
<BLOCKQUOTE><OL>
<LI> Get the Velocity distribution.  This is available as a nightly snapshot or directly from the CVS code repository.  Either way is fine.  For more information, go <A href="index.html">here</A>.</LI>
<LI> Go to the <CODE><FONT face="courier, monospaced">build</FONT></CODE> directory in the distribution.</LI>
<LI> Type <CODE><FONT face="courier, monospaced">./build-velocity.sh jar</FONT></CODE> under Unix, or <CODE><FONT face="courier, monospaced">build-velocity.bat jar</FONT></CODE> under Windows.  The major build targets are :
<BLOCKQUOTE><UL>
<LI> <CODE><FONT face="courier, monospaced">jar</FONT></CODE> builds the complete Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory.  This jar will be called 'velocity-X.jar', where 'X' is the current version number.  Unless you have specific storage space considerations, use this jar for convenience, as it includes everything you need.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-core</FONT></CODE> builds a slimmer Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-core-X.jar'. This
jar contains the core Velocity functionality, and doesn't include example and utility things like Anakia, Texen or 
the VelocityServlet support baseclass.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-util</FONT></CODE> builds a utility Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-util-X.jar'. This
jar contains utility code, specifically Anakia, Texen, and the WebMacro template conversion utility.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-servlet</FONT></CODE> builds a utility Velocity jar in the <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-servlet-X.jar'. This
jar contains utility code for servlet programmers.</LI>
<LI> <CODE><FONT face="courier, monospaced">jar-j2ee</FONT></CODE> builds a complete jar, like the 'jar' target, that includes any components that require J2EE support.  Currently, this includes only org.apache.velocity.runtime.resouce.loader.DBResourceLoader.  As usual, it is placed in the  <CODE><FONT face="courier, monospaced">bin</FONT></CODE> directory, called 'velocity-j2ee-X.jar'.  NOTE : 
if you wish to use this build target, you must place (or link) a copy of j2ee.jar into the build/lib directory.  We do not provide it as part of the distribution.  A good source is http://java.sun.com/</LI>
<LI> <CODE><FONT face="courier, monospaced">examples</FONT></CODE> builds the example code in the example programs found in the <CODE><FONT face="courier, monospaced">examples</FONT></CODE> directory. 
This build target will also build the forumdemo example project.</LI>
<LI> <CODE><FONT face="courier, monospaced">forumdemo</FONT></CODE> builds the example webapplication in the <CODE><FONT face="courier, monospaced">examples/forumdemo</FONT></CODE> directory.</LI>
<LI> <CODE><FONT face="courier, monospaced">docs</FONT></CODE> builds these docs in the <CODE><FONT face="courier, monospaced">docs</FONT></CODE> directory</LI>
<LI> <CODE><FONT face="courier, monospaced">javadocs</FONT></CODE> builds the Javadoc class documentation in the <CODE><FONT face="courier, monospaced">docs/apidocs</FONT></CODE> directory</LI>
<LI> <CODE><FONT face="courier, monospaced">test</FONT></CODE> (after jar) will test Velocity against it's testbed suite of test routines </LI>
</UL></BLOCKQUOTE></LI>
<LI> While not required, testing the build is a good idea.  Use the <CODE><FONT face="courier, monospaced">test</FONT></CODE> target mentioned above.</LI>
<LI> That's it!  Velocity is ready to be used.  Put the jar into your classpath, or into other appropriate places (such as the lib directory of your webapp if using with servlets)</LI>
<LI> If you want to play with the examples, which is highly recommended when getting started, use build the examples via 
<CODE><FONT face="courier, monospaced">./build-velocity.sh examples</FONT></CODE> or <CODE><FONT face="courier, monospaced">build-velocity.bat examples</FONT></CODE>.</LI>
</OL></BLOCKQUOTE>
</P>
</FONT></TD></TR></TABLE></DIV><BR>

<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD bgcolor="#023264" width="100%"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="5"><B>Resources</B></FONT></TD></TR><TR><TD><IMG border="0" height="5" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="98%"><TR><TD><FONT color="#000000" face="arial,helvetica,sanserif">
<P align="justify">
There are quite a few resources and examples available to the programmer, and we recommend that you look at our examples, documentation and even the source code.  Some great sources are :

<BLOCKQUOTE><UL>
<LI> source code : <CODE><FONT face="courier, monospaced">src/java/...</FONT></CODE> : all the source code to the Velocity project</LI>
<LI> application example 1 : <CODE><FONT face="courier, monospaced">examples/app_example1</FONT></CODE> : a simple example showing how to use Velocity in an application
program. </LI>
<LI> application example 2 : <CODE><FONT face="courier, monospaced">examples/app_example2</FONT></CODE> : a simple example showing how to use Velocity in an application
program using the Velocity application utility class. </LI>
<LI> servlet example : <CODE><FONT face="courier, monospaced">examples/servlet_example1</FONT></CODE> : a simple example showing how to use Velocity in a servlet. </LI>
<LI> Anakia application : <CODE><FONT face="courier, monospaced">examples/anakia</FONT></CODE> :  example application showing how to use Velocity for creating 
stylesheet renderings of xml data </LI>
{'fraction_non_alphanumeric': 0.18018872634679714, 'fraction_numerical': 0.01647610964102052, 'mean_word_length': 6.569916855631141, 'pattern_counts': {'":': 0, '<': 739, '<?xml version=': 0, '>': 739, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2851276', 'n_tokens_mistral': 6709, 'n_tokens_neox': 6223, 'n_words': 1805}