velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <>
Subject RE: Velocity Vs JavaScript
Date Tue, 08 Oct 2002 21:58:36 GMT
What I love about Velocity is what you are not allowed to do in it.

I hate HTML, but I love working with Velocity because it makes dynamic text
a breeze.  I just focus on placement of where things sit.  If I want
something more complex, I go and do it in Java, which is where the power to
do complex things easy is, and just drop the interesting object in the
context to be used.

It's going to be a cold day in the proverbial before I start coding Objects
in a scripting language again (i.e. ASP/JSP, I'm glad I've made the
transistion).  Things quickly turn into a pigs breakfast using them.



-----Original Message-----
From: Bill Burton []
Sent: Wednesday, 9 October 2002 2:23 AM
To: Velocity Users List
Subject: Re: Velocity Vs JavaScript


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:

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

View raw message