• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

EL, JSTL, Custom tags

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know using is really bad. In my project we have used scriplets everywhere. Can i get some links which clearly talks about the disadvantages of using scriptlets and advantages of using EL, Custom TAgs, JSTL and Standard actions.
Please provide pointers.
Thanks
Deepak
[ August 19, 2008: Message edited by: Deepak Jain ]
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happened when you searched the net with Google or any other search engine for such links?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well the main purpose and advantage in using EL,custom tags etc...is to provide easier way for web page designers. Designers need not know logic programming so we(programmers) have to provide them a lighter way by absorbing the pain of programming. And as a result EL ,custom tags, standard actions evolved...

if you are the programmer as well as designer....then obviously you love scripting...but when it comes to maintenance/re usability script-lets becomes big trouble. Pages with script-lets are hard to read & its tough for others to use your code.
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pages with script-lets are hard to read & its tough for others to use your code.

Not necessarily; compare:with the equivalent in EL/JSTL:Anyone familiar with PHP or JavaScript will be fairly familiar with the scriptlet syntax (though the API details are obviously Java-specific), while the actions are totally unfamiliar and will likely just confuse them.

The main problem arising from my code above is that arbitrary Java methods cannot be invoked by EL, so we have a problem at the ???. You'd need to either put that in a front controller, a scriptlet which injects the Locales into scoped attributes, or use a custom tag, which makes it more complicated already.

There are also performance overheads to consider. Invoking the methods of custom tags has a larger overhead than code inserted directly into the scriptlet and then optimised further by the standard Java compiler. Although typically small overheads, they can add up on a very busy system.

So I think you need to use both wisely - if the code you produce is equally readable in either syntax, think about which is going to be the most straightforward for you. Always separate logic from presentation, but where presentational logic is concerned, both approaches offer their own benefits.
[ August 14, 2008: Message edited by: Charles Lyons ]
 
Sheriff
Posts: 67752
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

Originally posted by Charles Lyons:
Not necessarily; compare:

Couldn't disagree more. I find the JSTL much clearer and easier to inspect.

And, if it's not easy to do something with JSTL/EL, it's either a red flag that something's being done that shouldn't be, or it's something that's easy to set up using the custom mechanisms defined by JSP 2.0.

At this stage, it is my opinion that scriptlets should be considered deprecated.
[ August 14, 2008: Message edited by: Bear Bibeault ]
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have to agree with Bear. Scriptlets should be avoided at all costs. JSTL and the EL are much easier to work with.
 
I knew that guy would be trouble! Thanks tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic