velocity-user mailing list archives

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

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 (http://www.beanshell.org/) and other 
scripting languages written in Java.  Or using the Bean Scripting 
Framework (BSF) at 
http://oss.software.ibm.com/developerworks/projects/bsf, you can code to 
an API that would let you plug any any of the supported scripting languages.

-Bill


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message