On Wed, 4 Jun 2003, Dan Eklund wrote:

> Date: Wed, 4 Jun 2003 18:25:43 -0400
> From: Dan Eklund <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: RE: struts (and JSTL) expression language questions
>
> 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
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.

> 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.

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.

Craig McClanahan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to