Hans,
Thanks for the detailed response. One more question that's somewhat
related. One of the most basic and powerful features in a language is
the ability to chain things, but I haven't seen any indications that you
can do this with tags, without going into Java. For instance let's say
that you have a tag that does concatenation and a tag that does toupper
(Converts things to upper case. You'd want to do
<concat> first='a' second='b' </concat> ==> 'ab'
<toupper> string='aaa' </toupper> ==> 'AAA'
I'd like to be able to do something like
<toupper>
<concat> first='a' second='b' </concat>
</toupper>
And have it produce 'AB', but seems like you can't do this with custom
JSP tags. Am I missing something? Is there a pattern that lets you do
this elegantly or somewhat elegantly?
Is this something that would be easier to do with the EL?
Thanks,
Dror
On Thu, Sep 12, 2002 at 10:32:39AM -0700, Hans Bergsten wrote:
> 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
--
Dror Matalon
Zapatec Inc
1700 MLK Way
Berkeley, CA 94709
http://www.zapatec.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