velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edmund Urbani <>
Subject Re: Velocity vs JSP vs FreeMarker
Date Thu, 07 Apr 2005 08:58:23 GMT
Will Glass-Husain wrote:
> Thanks for sharing your thoughts.
> Actually, with the caching turned on serving Velocity pages is pretty 
> fast. Many say faster than JSP, though I haven't personally run any 
> benchmarks.  I agree though this isn't generally relevant in a typical 
> webapp.
> I'd note that another benefit of Velocity is that you can use it for any 
> text processing (e.g. sending emails) while JSP is web only.

True. Velocity is a good general purpose templating engine. I use it for a
few things other than rendering web pages. Things that can't be done with JSP.

Malcolm Edgar wrote:
 > For development I find JSP stacktrace not very useful (JSP source code is
 > generally very ugly). With Velocity you if you stuff up you will simply see
 > your rendered Velocity code, or a useful ParsingException if you stuff up
 > really badly.

I can't quite agree with this. I use velocity with turbine and I have seen
stack-traces with velocity classes in it and no clue which template velocity
was parsing when the exception was thrown. With JSP you can tell which page
was involved because of the classname of the compiled page.
BTW I don't usually get ParsingExceptions, because my IDE (Eclipse with
Velocity Web Edit plugin) does syntax checking for me.

Jian wrote:
 > 1) Velocity syntax is very easy to recognize in any html template.
 > Other templating systems like FreeMarker, makes it really hard to see
 > what is the artificial html and what is the real one.
I agree that it is probably faster to get into (syntax-wise) than JSP.

 > 4) Velocity engine itself also provides a very small footprint I think
 > compared to the full-blown JSP engine with all the "fancy" features
 > that might get used once in a blue moon.
A servlet container like tomcat has got an integrated JSP engine. Whether
you use it or not, it's there. I'm not sure whether it's "full-blown" or
"fancy" to you. I assume "fancy" refers to JSF or some taglibs or something.

 > 5) There are much more benefits using Velocity than JSP which I don't
 > need to list here.	
Please do! :)

Florin wrote:
 > On production runtime speed: I was also concerned about the speed but I
 > found out that there are so many other speed-eating issues in a full-blown
 > webapp that the difference between rendering JSP and rendering Velocity
 > simply does not count.
Last summer I did some profiling on a turbine/velocity project. I managed to
improve performance quite significally by introducing caching in a few places.
After that the major CPU eater became java reflection (used mainly by velocity),
and it still is. Performance is OK now, but if I had to further improve it, I
would probably have to start replacing Velocity templates with JSP.

Of course you can make JSP slow by using the right (or rather: wrong) taglibs.
Also, you certainly can do a lot of weird things with some taglibs (eg. JSTL
does have SQL tags. for heaven's sake: don't use those!).

IMO one of the major disadvantages of JSP - and main reason why I switched to
velocity in the first place - is, that you cannot expect a web designer, who is
not also a Java programmer, to understand the compile errors you can get from

But still, if everyone on the project does know enough about Java/JSP (or the
budget is big enough to take on the steep learning curve), I would prefer
JSP to velocity.


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

View raw message