What is velocity2js?

Velocity2Js compiles Apache Velocity templates to JavaScript functions. These functions can be used in ajax based web applications.

Velocity2Js provides an ant task to integrate template compilation in an existing build process.

Take Advantages of Templates

When using Ajax and JSON to implement dynamic wep applications, one quick runs into writing JavaScript functions with a bunch of HTML-Snippets concatenations. These functions soon get very long and unreadable. The idea of Velocity2Js is to use the advantages of templates like they are used in traditional web application (eg. JSP, Velocity in Webwork or Freemarker in Struts2). As templates are static and part of the web application they can be compiled at the web application's built time.

How it Works

Each velocity template will be transformed in one Javascript function. This function is called with an associative array (like it's used in JSON protocol) as input parameter and returns a string as output. The result string contains a html snippet, which can be included in the html document.

Explore potential of velocity2js

Explore the potential of velocity2js in "Tiny Test Shop"!
demo

RECENT NEWS

2007-05-12:
Version 0.3 released!
Download

coming soon:
Velocity2js Support for Netbeans!
Includes syntax highlighting for Velocity templates.