File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Is JSTL useful?" Watch "Is JSTL useful?" New topic
Author

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
Author
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 http://java.sun.com/products/jsp/jstl. At Jakarta Taglibs, we provide a complete, product-quality reference implementation of the tags: it's the "Standard Taglib" available through http://jakarta.apache.org/taglibs. 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="http://www.jstlbook.com" target="_blank" rel="nofollow">http://www.jstlbook.com</a>
Ricardo Marques
Greenhorn

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
Rancher

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
http://jakarta.apache.org/taglibs/
To get to Jakarta taglibs


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
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.
Simon
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: http://aspose.com/file-tools
 
subject: Is JSTL useful?