velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edmund Urbani <...@liland.org>
Subject Re: Velocity vs JSP vs FreeMarker
Date Wed, 06 Apr 2005 15:26:45 GMT
Ryan Lea wrote:
> Just wondering if anyone has used/tried/investigated all 3 of these as
> views (from MVC) and has any opinions on them??
>  
> As a bit of a site note as well, has anyone used them with WebWork??
>  
> cheers
> 
> Ryan Lea
> Web Developer
> 

I have got experience with JSP and Velocity (never used FreeMarker or WebWork).
I started with JSP a few years back, then I switched to Velocity and
right now I am considering to go back to JSP for a new project.

Both allow developers to stick to MVC and create nice, clean, maintainable pages.
Both allow developers to mess around.

Velocity does have a nice syntax for simple things like iterations, ifs, sets
and you can define macros, which can be very useful to let templates share
things. You need no Java code to do this, it's all built-in. You can not
include Java Code in your templates (that may be considered both - a good and
a bad thing). Velocity does unexpected things with null values, or rather it does
not do anything with them besides writing to the log.

In comparison JSPs are faster (once they have been compiled) and they will always
be, because they do not rely on reflection/bean mechanisms. To me, the fact
that JSP is compiled to Java classes is its biggest advantage over templating engines
like Velocity, and the reason why I am considering switching back to it.
Compiling does inform you about many sorts of errors you can make EARLY (build-time
vs run-time). Also, because JSPs do get translated to Java Code, I can use all kinds
of Java development tools on them. Eg. I can take a look at the call hierarchie
of one of my methods and see which JSPs use that method (that advantage can be
eliminated by using <jsp:bean /> tags instead of simply calling get-methods).

Well, now that I have said that much in favor of JSP, I can already feel the wrath
of the velocity community upon me - just kidding ;)

I hope that someone will speak in favor of Velocity on this list though!

Cheers
  Edmund

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


Mime
View raw message