velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Burton <>
Subject Re: Velocity Vs JavaScript
Date Tue, 08 Oct 2002 16:23:19 GMT

RXZ JLo wrote:
> From my first look at Velocity, it seems to follow
> EcmaScript style - you predefine objects, with the
> properties accessible via get/set methods.
> Why not just use JavaScript instead? 

As others have pointed out, JavaScript is not a template language but a 
programming language.  Velocity is designed for writing templates so what 
logic this is is very minumal (but sufficent) for template applications.

However, it could make sense to use JavaScript with Velocity.  Instead of 
coding objects in Java, they could be coded in JavaScript and exposed to 
Velocity as Java objects.  Some of the web frameworks support this such as 
WebWork and one other that escapes my mind.  I also recall someone on this 
list who wrote their own framework that used JavaScript to expose objects 
in Velocity templates.

The same thing applies to BeanShell ( and other 
scripting languages written in Java.  Or using the Bean Scripting 
Framework (BSF) at, you can code to 
an API that would let you plug any any of the supported scripting languages.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message