blob: 183e055d4051aae2f55586429aa3035c39e2b8e3 [file] [log] [blame]
<html>
<head>
<title>VelocityStruts - Overview</title>
<meta name="author" value="Gabriel Sidler"/>
<meta name="email" value="sidler@apache.org" />
<meta name="author" value="Tim Colson"/>
<meta name="email" value="tcolson@cisco.com" />
<meta name="author" value="Nathan Bubna"/>
<meta name="email" value="nbubna@apache.org" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">
<table border="0" width="100%" cellspacing="4">
<tr><td colspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif"
align="left" alt="The Jakarta Project" border="0"/>
</a>
<a href="index.html">
<img src="../images/velocitystruts.png" align="right" alt="< Velocity Tools - Struts >" border="0"/>
</a>
</td></tr>
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="true">
<p><strong><a href="../">Velocity Tools</a></strong></p>
<p>
<strong>VelocityStruts</strong>
</p>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="index.html#Benefits">Benefits</a></li>
<li><a href="../index.html#Download">Download</a></li>
<li><a href="userguide.html">User Guide</a></li>
<li><a href="userguide.html#Installation">Installation</a></li>
<li><a href="../index.html#Example Applications">Examples</a></li>
<li><a href="../javadoc/index.html">Javadoc</a></li>
</ul>
<p>
<a href="StrutsTools.html"><strong>VelocityStruts Tools</strong></a>
</p>
<ul>
<li><a href="ActionMessagesTool.html">ActionMessagesTool</a></li>
<li><a href="ErrorsTool.html">ErrorsTool</a></li>
<li><a href="FormTool.html">FormTool</a></li>
<li><a href="MessageTool.html">MessageTool</a></li>
<li><a href="StrutsLinkTool.html">StrutsLinkTool</a></li>
<li><a href="SecureLinkTool.html">SecureLinkTool</a></li>
<li><a href="TilesTool.html">TilesTool</a></li>
<li><a href="ValidatorTool.html">ValidatorTool</a></li>
</ul>
<p>
<strong>Other Subprojects</strong>
</p>
<ul>
<li><a href="../generic/">GenericTools</a></li>
<li><a href="../view/">VelocityView</a></li>
</ul>
<p>
</p>
</td>
<!-- RIGHT SIDE MAIN BODY -->
<td colspan="1" valign="top" align="left">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="2" bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="Overview">
<strong>Overview</strong></a></font>
</td>
</tr>
<tr>
<td NOWRAP> &nbsp; &nbsp; &nbsp; &nbsp; </td>
<td>
<p>The VelocityStruts sub-project integrates Velocity with the
<a href="http://struts.apache.org/">Apache Struts</a>
web application framework and enables the use of Velocity templates
interchangeably with JSP pages for the view layer.</p>
<p>Various other
<a href="http://wiki.apache.org/jakarta-velocity/PoweredByVelocity">web application frameworks</a>
offer built-in support for Velocity templates. This project
provides the minimal glue necessary to give Struts developers
an alternative to JSP. </p>
<p><img src="../images/velstruts_diag1.png" border="0"/></p>
<p><strong>Diagram 1.</strong> Comparison of JSP and Velocity for
the view layer in a Struts application.</p>
<p>As we follow the typical Struts process flow in Diagram 1,
notice how there is relatively little change except for the addition
of Velocity. The velocity-struts.jar leverages a standalone Velocity
servlet to process template files (specifically, the jar file is
velocity-tools-x.x.jar) and uses some drop-in tools to provide
transparent access to Struts specific objects (ex. message resources,
form beans, errors, links). The action mapping file will simply contain
ActionForwards that send control to a Velocity-based View layer instead
of sending to a JSP. </p>
<p>Also notable is that Velocity and JSP are <strong>not</strong>
mutually exclusive. Both technologies can be used in the same
application without any problems. This allows developers the option
of trying Velocity without heavy modification to existing applications.</p>
<p>We're convinced that once you give Velocity a try, you'll really like it.</p>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="2" bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="Benefits">
<strong>Benefits</strong></a></font>
</td>
</tr>
<tr>
<td NOWRAP> &nbsp; &nbsp; &nbsp; &nbsp; </td>
<td>
<p>There are many different reasons why people are choosing Velocity
technology for the view layer. Here are some:</p>
<p>
<ul>
<li>Velocity helps enforce a clean separation between the view
layer and the model/control layers. This leads to clean application
design and a clear separation of concerns between View Designers
and back-end Developers.</li>
<li><a href="http://jakarta.apache.org/velocity/vtl-reference-guide.html">Velocity Template Language (VTL)</a>
has few directives and is simple and easy to learn. Most
people report being productive within a day.</li>
<li>Velocity is easy to extend with <i>Tools</i> which are simply
any class which has public methods. These are typically much cleaner
and easier to develop than JSP custom tag libraries.</li>
<li>Using the new TilesTool it is now possible
to mix Velocity and JSP tiles in the same page/layout. For those
using Tiles, this makes gradual migration between or integration of
the two view technologies trivially easy!</li>
<li>Velocity 'macros' are a powerful tool for the View Designer.
They enable the creation of reusable snippets of markup, often
eliminating what would have been a need to develop a custom tag
library or other server-side tool.</li>
<li>Velocity templates are <strong>not</strong> limited to HTML
and can be used to produce any type of text output including XML,
SQL, ASCII, PostScript, etc.</li>
<li>Velocity enables easy access to dynamic data
that Web Designers can understand.</li>
<li>Velocity being interpreted, enables a simple development cycle
where template errors can quickly be localized and debugged.</li>
<li>Velocity, which caches templates for speed, has been reported
to have performance comparable or better than JSP.</li>
<li>Velocity is <strong>supported</strong> by an active and helpful
community of users and developers.</li>
</ul>
</p>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="2" bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="Success Stories">
<strong>Success Stories</strong></a></font>
</td>
</tr>
<tr>
<td NOWRAP> &nbsp; &nbsp; &nbsp; &nbsp; </td>
<td>
<p>Comments from folks who are using Struts and Velocity:</p>
<p>
<blockquote>
<p>"<i>We've been using Struts/Velocity for some time now and we find it to be
an extremely well matched combination. One of the main advantages of
Velocity is that the syntax is incredibly easy. I can explain it to a
designer who has never seen it before and expect them to be useful
within an hour.</i>" </p>
<p>"<i>One of the nicest things it enforces is the separation of presentation
layer and business logic. It removes the desire to 'fix' problems by
just putting a small change into the JSP via scriptlets. It also makes
the code a <strong>lot</strong> more readable which also reduces the
development time.</i>"</p>
<p>"<i>Struts is a solid framework and Velocity makes it
even better.</i>"</p>
<p>"<i>I find that the Velocity Tools for Struts works as well, or better, with
Struts than another other presentation technology, bar none. In fact,
most of the tools work just as well with any other framework you might
care to name.</i>"
--<a href="http://marc.theaimsgroup.com/?l=velocity-user&amp;m=106520662105461&amp;w=25">Ted Husted</a>
(author of <a href="http://husted.com/struts/book.html">Struts in Action</a>)</p>
</blockquote>
</p>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="2" bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="License">
<strong>License</strong></a></font>
</td>
</tr>
<tr>
<td NOWRAP> &nbsp; &nbsp; &nbsp; &nbsp; </td>
<td>
<p>This software is licensed under the
<a href="http://jakarta.apache.org/velocity/license.html">Apache Software License 2.0</a></p>
</td>
</tr>
</table>
</td>
</tr>
<!-- FOOTER SEPARATOR -->
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<!-- PAGE FOOTER -->
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright &#169; 1999-2003, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</body>
</html>