jQuery in Action, 3rd edition
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSTL - does it really make life simpler? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSTL - does it really make life simpler?" Watch "JSTL - does it really make life simpler?" New topic

JSTL - does it really make life simpler?

Edmund Yong
Ranch Hand

Joined: Nov 16, 2003
Posts: 164
The ultimate goal of JSTL is to help simplify JSP authors� lives. A page author is someone who is responsible for the design of a web application�s
presentation layer using JSP pages. Many page authors are not fluent in any
programming language.

However, in JSTL, the page author still need to know SQL in order to use <c:query>, <c:update>, etc. To use <c:forEach>, <c:if>, etc, he also needs to understand programming constructs such as iterations and if conditions. And he also needs to understand objects, attributes and sessions in order to use <c:set>, <c:remove>, etc.

If the page author needs to understand the above, he might as well learn Java and use scriptlets in the JSP instead. For the Java programmer, learning the JSTL would be like learning another language, and he would be better off using just scriptlets in the JSP.

So can anyone give me a convincing reason why we should use JSTL instead of scriptlets?

SCJP 1.2, SCWCD 1.4
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
There are many reasons to use things like custom tags and EL, but they return to the most important design principles "encapsulation" and "reusability".

As a Java programmer I still find EL and tags much easier to maintain, more powerful and cleaner to use that scriptlets.

If tags and EL are used right page authors find them conceptually easy to understand - the learning curve is much better (from my experience).

As for SQL JSTL's - I think their use is very limited, SQL should really be limited to model code, leaving JSP pages to use Collections of JavaBeans.

Drinking more tea is the key...
Sergey Tyulkin
Ranch Hand

Joined: May 10, 2005
Posts: 87
All we (java web developers) understand, that once the UI designer prepared the mock view of the web application, we must convert those html pages to jsp pages. And then hardly ever the designer will changed these jsp pages.
I prefer JSTL because of:
1) It is simplier to write ${} insted of <% pageContext.findAttribute()>
2) It uses xml syntax, so such page easier to validate
3) I think the developer will create better code with JSTL tags, because they less error-prone
4) We already use JSP standard actions and develop our custom tags, then why shouldn't we use JSTL?
I agree. Here's the link: http://aspose.com/file-tools
subject: JSTL - does it really make life simpler?
It's not a secret anymore!