tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <>
Subject Re: What is the rationale: (was RE: is there a better way to do this without JSP Script var)
Date Mon, 05 Aug 2002 14:30:34 GMT
On Mon, 5 Aug 2002, Dennis Doubleday wrote:

> This is not a troll, this is an honest question.
> Is there a reason for an experienced Java programmer to prefer JSTL
> expression language over just using Java scripting?

It's certainly a valid question.  Novice page authors are the primary
target for JSTL, but I find JSTL useful even as an advanced Java
developer.  There are two broad reasons -- my pages will be easier to
maintain by novice page authors, and I get to use the abstractions that
JSTL provides, which saves a little time.

I agree with you; the latter point -- abstraction and reusability -- isn't
too important when you're dealing with simple conditions.  But if I'm
building a small site, the SQL and XML tags save me time since I don't
have to write similar logic in Java.  And even for something as
straightforward as iteration, I find I prefer <c:forEach> to writing a
'for' or 'while' block myself in the middle of a page.  It's easier to
debug if I make a typographical error, and it saves a number of type casts
and other little details.  (It also makes my page "scriptless," which
provides opportunities for optimization and flexibility in future versions
of JSP.)

Still, the primary interaction that advanced Java developers will likely
have with JSTL will involve exposing logic and code to page authors using
the interfaces and support libraries that JSTL provides.  (E.g., setting a
default DataSource or locale, or providing data in EL-accessible
structures.)  The JSTL spec covers more than just a set of tag libraries;
it also provides a set of back-end interfaces and classes that simplify
the contract between the page author and the developer.

Shawn Bayern
"JSTL in Action"

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

View raw message