Velocity « Web Development « Java Articles

Java Articles
1. Build Deploy
2. Class
3. Core Library
4. Data Types
5. Database JDBC
6. Design
7. Development
8. File Input Output
9. Graphics Desktop
10. J2EE Enterprise
11. J2ME Wireless
12. JVM
13. Language
14. Library Product
15. Network
16. Security
17. SOA Web Services
18. Test
19. Web Development
20. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Products
Java by API
Photoshop Tutorial
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Articles » Web Development » Velocity 
1. Complex HTML tables made easy with Apache Velocity
"The Apache Velocity template engine simplifies creation of textual content by merging data contained in a Java object model with Velocity templates. But creating complex HTML tables with cells that span multiple columns and rows can lead to elaborate nested hierarchies of Velocity directives, which quickly render the Velocity template difficult to read and maintain. In this article Matthias Laux introduces a Java package that simplifies handling of even highly complex HTML tables, using a small number of directives while retaining all the benefits of Velocity for HTML generation. The package is independent of Apache Velocity and can potentially be used with other rendering schemes, such as JavaServer Pages."

2. Start up the Velocity Template Engine
"In this article, I present a short primer on the Velocity Template Engine and its template language, Velocity Template Language (VTL). I also demonstrate how to use Velocity through several examples."

3. Velocity or FreeMarker?
"Template engines can be applied to a wide variety of development scenarios where you want to generate text based on specific processing rules, and are often used as the view component in MVC applications. In this article, Jeroen van Bergen explains where template engines fit into your application architecture and shows you some of the operations common to all template engines. Finally, he compares the two leading Java template engines, Velocity and FreeMarker, in terms of power, ease of use, and performance."

4. Migrating to Velocity
"There are a variety of choices when it comes to producing dynamic web content. Typically, most projects will go with the accepted or de facto standards, so chances are, if the platform choice for your project is Java, you're likely to be using JSPs. This makes sense for a number of reasons: new staff are more likely to have experience with a standard; a number of web servers support JSPs, thus giving you a wide choice of web platforms; there is plenty of documentation available since people have usually "done it before"; and so on. However, sometimes using the standard isn't the best choice. Perhaps you need or want more direct control over the code producing your content; perhaps you have performance issues with JSPs; or maybe it's just that a new technical direction within your company is pushing away from that paradigm. Velocity is a simple, yet powerful, templating engine that can be used to generate dynamic content as an alternative to the incumbent standard. In some cases it provides a performance advantage over JSPs, and it certainly forces a web developer to think differently about separating content from code."

5. Template-Based Code Generation with Apache Velocity, Part 2
"As described in part one of this series, code generation typically uses a template engine to transform some kind of "model" into compilable code, given the formatting specified by a template. In this second part of the series, I will show how to use Velocity inside of a code generator that is based on a well-defined Internal Object Model (IOM). You will see two different strategies:"

6. Template-Based Code Generation with Apache Velocity, Part 1
"Most of the real-world code generators, both commercial and open source releases, use templates and template engines. In this article I'm going to discuss template-based code generation, explain basic concepts related to templates and transformations, and demonstrate the huge benefits they can bring in code generation. Then, I'll implement a simple code generator in Java that uses Velocity, an open source template engine provided by Apache. The generator takes an XML representation of classes and data members and generates the Java code to define them. The generation process will be driven by a template that encapsulates the syntax of the target programming language. You will see how to change the template to generate different types of source code."

7. Velocity: A template engine OR A Rule engine OR Both?
"Most of the developers must be familiar with Velocity as a great open source template engine and I don?t think I need to say much about its uses and features as a template engine. This paper compiles its features as a rule engine."

8. Pro Jakarta Velocity Chapters
"The introductory chapter looks at the concept of template engines, their specific uses and provides a whirlwind rundown on the basics of Velocity's feature set. Chapter 2 takes you through the basics of getting Velocity installed, writing some templates, and creating some output. Chapter 5 shows you how to build full applications with Velocity, both for the desktop and the Web. It focuses on building a simple e-mail newsletter app with Swing and Velocity."

9. Velocity: Fast Track to Templating
"Velocity is a fast and easy-to-use Java-based templating engine. Velocity's speed, ease of use, and flexibility contribute to its use in a broad range of applications, including code generation, email templating, and web user-interface creation. A template is a parameterized, predesigned text format. A template engine processes a template and fills in the parameterized pieces with concrete data. The bulk of this article focuses on email templating with Velocity. The template, in this context, is an email body with special syntax used to indicate points within the email to insert specific data, such as a name, order number, or order details. This article first introduces Velocity with a simple, easy-to-run example, then briefly covers the templating syntax, and ends with a full-featured and detailed look at Velocity in action for templating automated emails."

10. TSS Featured Entry: FreeMarker vs. Velocity
"The last couple of days, I've managed to convert the MyUsers sample app from JSP to Velocity, and also to FreeMarker. Since this app uses SiteMesh, this was fairly easy thanks to its Velocity Decorator and FreeMarker Decorator support. Of course, Spring supports both technologies as well - ref: Spring+Velocity and Spring+FreeMarker. The real slick part of Spring's integration is that I didn't really need to change any code to support either templating engine. All I had to change was the XML in action-servlet.xml! Very cool!"

11. Client and server-side templating with Velocity
"The manipulation and transformation of textual data in standard presentation or exchange formats such as HTML and XML is a frequent and often tedious activity in which every software developer engages. A templating engine can facilitate this process by maintaining the static portion of the output in templates, while dynamically generating and positioning the changing portions. Velocity is a highly functional, open source templating engine that you can easily integrate into either client-side or server-side applications."

12. Struts-Velocity integration
"I'll use a familiar search use case to illustrate the Struts-Velocity integration recipe. In this example, a simple application lets a user search for a book by its ISBN number. The application's results page presents a book matching the ISBN number."

13. Add Velocity to Your Development
"In it's simplest form, a template engine takes data, processes it and then displays it. For example, the data found in a company's employee list can be shown in a simple HTML page on the company's intranet or it can be simplied and seen on a salespersons' cellphone while he is on the road. The use of templates is what enables programmers and designers to interact and utilize the data in the most appropriate way. A very good example of what a template engine should be is Velocity."

w___ww___.j_av__a2__s__.c_o_m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.