In the beginning, a Web page was a static entity that provided the same infor
mation to all visitors. Developers soon wanted the ability to provide unique
data for their users. A large assortment of technologies came along to
address this desire--technologies like PHP, ASP, and JSP. While these languages
do solve the problem, they all lead to a much bigger issue.
Adding personalization to a Web site used to entail using one of those languages
and embedding it directly into the HTML tags for the site presentation.
Although this intermixing of code worked, it resulted in maintainability issues.
If developers wanted to alter the look and feel of a site, they had to reapply all
of the personalization code to the new HTML templates, or designers had to be
given access to the code to make changes directly.
Fortunately, the Model-View-Controller (MVC) paradigm completely separates
the personalization from the presentation and the data. With MVC, Web designers
create the presentation and Web developers handle the code. Velocity is a
technology that allows the separation of Java Web code from the presentation
code using MVC. Through the use of Java-based templates, Web designers reference
personalization code written in Java.
With the help of extensive examples, this book provides a comprehensive
approach for using Velocity 1.3.x to create maintainable sites.