File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL - does it really make life simpler?

 
Edmund Yong
Ranch Hand
Posts: 164
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sergey Tyulkin
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic