File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Is JSTL useful? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Is JSTL useful?" Watch "Is JSTL useful?" New topic

Is JSTL useful?

Sean Li
Ranch Hand

Joined: Feb 27, 2002
Posts: 154
I've read the sun's tutorial of JSTL, I don't think that will be convenient but bothersome. Maybe i just cannot go through into it. Is there any experts here can tell me the really usage of that technique? thanks!
Shawn Bayern
Ranch Hand

Joined: May 06, 2002
Posts: 160
Originally posted by Sean Lee:
I've read the sun's tutorial of JSTL, I don't think that will be convenient but bothersome. Maybe i just cannot go through into it. Is there any experts here can tell me the really usage of that technique? thanks!

Well, I'm the reference-implementation lead for JSTL, so I'm hardly unbiased, but I think JSTL offers a clear, evoluationary advantage over prior ways of writing JSP pages. Keep in mind that JSTL is aimed primarily at page authors -- those whose job it is to design and publish pages using HTML or other markup languages. If you're a hard-core programmer, it's not primarily intended for you, although there are many things about it that will probably be convenient anyway.
For example, JSTL offers an "imperative" approach toward XML manipulation, which is substantially easier than XSLT's approach. Instead of writing functional, recursive stylesheets, you can simply say, "Find the first <p> element and print out its content," or "loop over every <item> element, printing out its 'id' attribute." You'll find tags for such functions in JSTL's "XML" library.
The other JSTL libraries are similarly convenient -- they provide easy ways to access databases, format text, and so forth. I programmed a large portion of JSTL's tags, and I still find it useful to use JSTL's tags rather than to rewrite functionality in Java.
I'd take a look at the newest version of JSTL; the standard is about to become finalized, and the Proposed Final Draft is available through At Jakarta Taglibs, we provide a complete, product-quality reference implementation of the tags: it's the "Standard Taglib" available through In my upcoming book, I describe some of the more specific advantages of JSTL.
Please let me know if you have any questions, or if you're still not clear on JSTL's purpose. Its major goal is to support the separation of business logic from presentation logic by letting you write JSTL pages without using any Java. Scriptlets are notoriously unmaintainable, difficult to debug, and hard for nonprogrammers to work with; JSTL is, by contrast, much easier to maintain and more accessible to nonprogrammers.

Shawn Bayern<br />"JSTL in Action" <a href="" target="_blank" rel="nofollow"></a>
Ricardo Marques

Joined: May 08, 2002
Posts: 27
I have used some of the tags, and re-used some of them, and they have made my life a lot simpler when coding the pages.
I'm not the designer, I'm the programmer, but I have to integrate pages with a great design with wahtever needs to be done dynamically on that page.
Tags are a lot simpler to use than to include a bunch of java code in the page.

Sun Certified Programmer for the Java 2 Platform 1.4<p>If I can create, I will make mistakes. If I can learn with them, it must be some kind of art.
Marcus Green
arch rival

Joined: Sep 14, 1999
Posts: 2813
How exceedingly cool to have someone closely involved in the project to answer that question. BTW a trailing dot crept into one of those URL's, you can try
To get to Jakarta taglibs

SCWCD: Online Course, 50,000+ words and 200+ questions
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
Is JSTL useful? Undoubtedly!
Custom tags are a fantastic way of encapsulating common, recurring logic within your JSPs, and to have a standard specification and implementations that provide some of the basic (and not so basic!) tasks will save you so much time.
Ketan Khimani
Ranch Hand

Joined: Apr 25, 2001
Posts: 32
When considering the performance which way is Best to work with JSPs:
I) JSPs with Full of Scriptlets
II) JSPs with JavaBeans
II) JSPs with JSTL (or Custom TagLibrary)
Specifically where JSTL makes the difference? Like handling XML and DB with JSTL is easier Job, But if I am using Beans then writing down DB access code in Beans is reusable. So in that case Jsp-JavaBean is better approach.

Ketan Khimani<br />IBM J2EE Certified (Enterprise Connectivity)<br />IBM Websphere Certified
I agree. Here's the link:
subject: Is JSTL useful?
It's not a secret anymore!