Dror,

> Good article. I also went back and read the first part where you were
> talking about the JSTL expression language.
>
> How would development with the expression language compare to using a
> template engine like Velocity in your opinion? It seems that there's a
> lot of overlapping functionality.

In my opinion, JSP and Velocity are two technologies with the exact same
semantics (templates that mix static content with "code" to generate
dynamic content); they just use different syntax for the "code" part.
With JSTL and the EL, the syntax difference is minimized, but it still
exist. For instance, JSP/JSTL uses XML-element syntax for things like
loops and ifs, while Velocity includes features like this in their own
language. The JSTL EL only lets you access data and do simple
operations, such as compare values, add values, etc.

The main argument against JSP from the Velocity camp has always been
that since JSP allows you to include raw Java code in the template,
"it sucks" (their words, not mine). Another argument has been that it
is too hard to use JSP the "right way" since writing custom tags is
too hard, which I can agree with to some extent. I think JSTL and the
EL is a great improvement, since it minimizes the need for both custom
tags and raw Java code. JSP 2.0 will introduce an easier way to
write custom tags (using a special JSP file or as a Java class as today,
but with a much simpler API). The EL defined for JSP 2.0 also adds
support for function calls in an EL expression, and a function is much
easier to write than a custom tag (it's just a static method, declared
in the TLD). These two things will make it even is easier to use JSP
the "right way".

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to