On Tue, 20 Aug 2002, M. Simms wrote:

> This may be a dumb question, but can someone provide a really quick
> synopsis explaining WHY JSTL tags are preferable to regular JSP 1.1
> tags..... what are the benefits / advantages ? To me it seems like
> just another software layer (XPath) to learn, master and control......
> further making J2EE webdev even more complex.

JSTL tags are regular JSP tags; they can all be implemented with the
tag-extension API.  The real distinction is between custom, third-party
tags and standard, JSTL tags.  In other words, you can use a particular
vendor's proprietary tags, but if you use JSTL, then

 - you can take advantage of high-quality educational materials (books,
   articles, reference guides)
 - containers can recognize the tags and optimize them
 - you can reuse your skills across a broader set of environments
 - others are more likely to be able to maintain your pages

JSTL doesn't really add a new layer into the mix.  Instead, you can think
of it as reducing the extra baggage that pages carry around.  If a page
contains Java code (that is, scripting elements, or "scriptlets"), then
you've got to be a Java programmer to edit this presentation-tier
component; that seems like a waste.  Conversely, if it uses a single
vendor's tags -- or your own custom tags -- then it's less reusable and
draws less benefit from common abstractions.

To frame things another way, JSTL does not require that you learn XPath if
you weren't using it already.  The correct distinction isn't between
"learning XPath" and "not learning XPath," but between "using XPath in
some Java code within a JSP page" and "using XPath in a standard tag."
(Of course, the other option is "using XPath in a back-end Java
component"; it has its place there too but can be useful in
presentation-tier components that simply need to format and display XML.)
JSTL only uses XPath to manipulate XML; if you're not printing or
formatting XML, you need not learn anything new on that front.

Please let us know if you've got followup questions; I've been doing my
best to clear up some misconceptions about JSTL that a few users seem to
have.

--
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.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