• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

scriptlets Vs EL/JSTL

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello here,
I have scjp and currently preparing for scwcd.
In the course of my preparation, i discover that all that you can do with scriplets you can also do with El and JSTL and the author is trying to paint the picture that EL and JSTL in more powerful, convinent and of more performance relaible that scriplets, now my question is, can any any one give me more than ENOUGH REASON TO CHANGE FROM WRITING SCRIPLETS IN MY JSP AND MIGRATE TO EL AND JSTL.

On the althernative, is sun trying to face out scriptlets in JSPs?

Thanks
Juwonlo Ibigbami
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reasons to ditch scriptlets in favor of JSTL/EL has nothing to do with power, or performance. Rather,, in modern best practices, JSPs should not be units of processing, but units of view. They should be pure templates for the markup to be sent to the browser. As such, the design (and yes, limitations) of the JSTL and EL help to ensure that stuff that doesn't belong on a JSP doesn't get put onto a JSP.

This makes the JSPs much easier to create, maintain and extend.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ENOUGH REASON TO CHANGE FROM WRITING SCRIPLETS IN MY JSP AND MIGRATE TO EL AND JSTL.



1. JSTL and EL were introduced to "Replace" all the scriptlet needs in your JSP's. That's because JSP are meant to be "View related" as mentioned by Bear Bibeault, They provide the elegant and simple way of declaring what you want with all the Java code at the background.
One of the important reasons is that the "View" Aspects in any major projects are handled by "Designers" who may not be "Programmers" and hence, they are much more comfortable to "Read" or "create" JSP views using "Tags" rather than "Code".

2. Easy to Read, Maintain and Create JSP's with JSTL and EL.

3. Code Reusability. The tags are reusable but not the scriptlets which you create... unless you copy paste them
;)
[ November 19, 2008: Message edited by: srikanth nutigattu ]
 
Tell me how it all turns out. Here is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic