velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Edgar" <Malcolm.Ed...@macquarie.com>
Subject RE: Velocity vs JSP vs FreeMarker
Date Thu, 07 Apr 2005 00:00:25 GMT
In defense of Velocity :)

Velocity generally used to be faster than JSP but the improved JSP compiler, nudged JSPs ahead.

The performance benefit of JSP though is very marginal, and really depends upon what tag libs
are used. Tag libs often make heavy use of reflection internally. The OGNL library use in
Tapestry is a very heavy user of CPU.

One of the easiest ways of improving web tier performance is to use HTTP 1.1 gzip compression,
you should easily get a 30% boost and much more over WAN or for sites with large HTML tables.

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 would like to know what tool use use for editing JSP with, I am using MyEclipse 3.8.4 JSP
editor and it takes forever to load.

regards Malcolm Edgar

-----Original Message-----
From: Edmund Urbani [mailto:emu@liland.org]
Sent: Thursday, 7 April 2005 1:27 AM
To: Velocity Users List
Subject: Re: Velocity vs JSP vs FreeMarker


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



NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie
Bank or third parties. If you are not the intended recipient of this email you should not
read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and
should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any
emails or any attached files. The views or opinions expressed are the author's own and may
not reflect the views or opinions of Macquarie Bank.


---------------------------------------------------------------------
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