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 ]