>>one of the things I've liked about struts is its ability to filter 
>>into legacy code without asking too much...
>>
>>The issues I presented are of some concern to anyone who is 
>>thinking about using the struts-el  libraries.  I think, unlike the 
other 
>>struts tags,
>>that these libraries are not intended to be used by anyone who wants
>>to 'filter' their struts into old JSP/servlet applications.
>>
>
>They are also issues related to the fact that your code examples embed
>Java code inside the JSP pages, in scriptlets.  One of the primary

my point exactly :)    That is why I used the word 'filter' to imply 
legacy
code with scriptlets.  Thus my conclusion: "these libraries are not 
intended to be
used by anyone who wants to 'filter' their struts into old JSP/servlet 
applications."

>motivations of JSTL's expression language was to minimize the need to do
>this.  JSP 2.0 goes even further, by allowing you to use EL expressions
>anywhere in the page, not just in custom tag attributes -- plus an 
ability
>to declaratively prohibit the use of scriptlets entirely.
>
>The EL was *deliberately* not designed to operate with instance variables
>in the JSP page.  It was *deliberately* designed to make accessing beans
>in page/request/session/application scope easy, and to perform operations
>on them.  Therefore, it should hardly be surprising that you find a
>mismatch between the two approaches.

I think I conveyed the wrong tone in my original email. 
I am not very well informed on these matters, and for *me* it was 
surprising. 
Struts/JSTL/EL and the like is new stuff, for one like myself who has 
returned to
the front-end after a few years away. 

My email was/is an attempt to verify these discoveries
with those who would know better and surer.  Part of my job is to validate
these new technologies for a JSP/servlet application that's been running
in production for more than 2 years.  (It pains me to use the word
'legacy' for code that is less than 3 years old), and with this recent 
exchange
I think I can say confidently that if I want to use the EL-flavors of 
struts-tags
or JSTL-tags, then we will need to rethink the paradigm of our existing
code-base vis-a-vis scriptlets, method-scoped instance variables,
and static references to application-wide constants.... (all the things
I observed in my original email)

>>Unless you are starting an application from scratch (sans 
>>scriptlets)
>>and in true MVC style, the struts-el  seems not to be 
>>appropriate.... Granted, this is because struts-el is faithful to the EL 
spec.
>
>I agree that there's lots of JSP pages in the world with scriptlets, 
>and that it's a real pain to start over; but (whether you use Struts or 
>not) it really will lead to more maintainable web applications.  Reducing 

>the need for, and the use of, scriptlets has definitely been a goal in 
>the recent evolution of JSP, and you should think carefully when 
>deciding whether to (continue to) buck that trend.

I promise you, I'll try   :(

>
>Just as one further motivation -- the JSP page compiler can generate 
>pages that run faster, and can exceed 64 kb, if you avoid the use of 
>scriptlets.
>

I understand that my email-thread has veered away from normal struts 
usage,
and into a more esoteric vein.  I won't cloud up this mailing list with 
any more
posts.

(however, since I can't resist a parting 'observation')

I had expected a staggered approach to migrating people away from the
scriptlet world, and to ease adoption of EL.  (maybe it makes sense to
force the issue, and not allow adulterated models to proliferate.)
I don't know how difficult it is to allow for the intermixing of RT and 
EL, but
it might help those of us who are struggling against significant existing 
JSP/servlet codebases, if there were a way to do say:
        attribute="<%= AppConstants.SOME_CONSTANT %>:${empData.ID}"
or
        attribute="<%= java.net.URLEncoder.encode(${empData.address}) %>"

It is a hard (nearly impossible) task to convince some management teams
that in order to use this new (and I think better) technology, we will 
have to 
adopt an entirely new paradigm where taglibs perform operations and EL 
accesses data.

thanks for your response. i look forward to watching the EL and struts 
evolve.

Reply via email to