----- Original Message ----- From: "Craig R. McClanahan" <[EMAIL PROTECTED]> To: "Struts Developers List" <[EMAIL PROTECTED]> Sent: Saturday, April 06, 2002 5:15 PM Subject: Re: anyone care to clarify difference between struts and JSTL?
> > > On 3 Apr 2002, David M. Karr wrote: > > > Date: 03 Apr 2002 16:41:53 -0800 > > From: David M. Karr <[EMAIL PROTECTED]> > > Reply-To: Struts Developers List <[EMAIL PROTECTED]> > > To: Struts Developers List <[EMAIL PROTECTED]> > > Subject: Re: anyone care to clarify difference between struts and JSTL? > > > > >>>>> "Craig" == Craig R McClanahan <[EMAIL PROTECTED]> writes: > > > > Craig> My advice to Struts users is as follows: > > > > Craig> * If you're running on a Servlet 2.2 / JSP 1.1 container, you > > Craig> will not be able to use JSTL (it requires Servlet 2.3 / JSP 1.2). > > Craig> Go ahead and continue using the Struts tag libraries. > > > > Craig> * If you're running on a Servlet 2.3 / JSP 1.2 container, you > > Craig> should begin experimenting with JSTL. There is no problem in > > Craig> using both JSTL and Struts tags in the same page (although, > > Craig> obviously, the expression syntax is different). > > > > Craig> * Over time, I plan to add a few features to the Struts tags to > > Craig> ease migration to JSTL for the "bean" and "logic" libraries -- > > Craig> for example, I want to support the same expression language, and > > Craig> attribute names where that is possible. > > > > Craig> * Longer term, I suggest that page developers plan on using the JSTL > > Craig> tags in their applications, as quickly as it is feasible for you > > Craig> to do so. But we're not going to throw away the existing Struts > > Craig> tags any time soon, so they will continue to be available. > > > > Craig> (One other note -- the expression language itself will become part of JSP > > Craig> 1.3, so you'll be able to use it in template text as well as in custom tag > > Craig> attribute values.) > > > > It would seem reasonable to consider doing what the JSTL implementors did, > > which is creating two sets of tag libraries, one using the EL, and one using > > scriptlets. As it's logical to assume that the default for the JSTL is the EL, > > and not RT, for each TLD, they created a "-rt" version and a non-rt version, > > which assumes the EL. In the case of Struts, you would probably want the > > "default" to be the RT library, and for the "-el" library to be optional. By > > making both of these available at the same time, it allows people to fully > > experiment with both alternatives. This would only be worthwhile during the > > transition. Later releases wouldn't need this. > > > > I was actually thinking of a slightly different approach -- for each > Struts tag that accepts the name/property/scope triplet of attributes, > create a new attribute like "expr" that accepts an expression language > expression instead. I believe this will be easier to understand, because > the EL expression actually covers all three of these concepts, so it > wouldn't really make sense to interpret any of the existing attributes in > two different ways. > > Doing this would seem to avoid the need for dual libraries. Does that > make sense? This makes sense for the set of attributes you mention, but I have a feeling that the end result might be confusing for people. The problem is that it only provides for the use of the EL for that particular set of attributes. Other attributes that currently allow RTexpr values would still only allow RTexpr values, so people would have to combine the use of both the EL and RTexpr values for each tag instance (if they wanted to use the EL at all, that is). I actually think that addressing this would head us down the same path that I believe the JSTL EG followed in their discussions. To allow the use of the EL for other attributes, I recall one idea pursued by the EG was to allow for attribute variants. For example, if there was an attribute 'foo', there would be a parallel attribute 'foo_', where the former used RTexpr and the latter used the EL. At some point, that approach was discarded in favour of dual taglibs. It seems to me that the same approach would be logical for the Struts taglibs, and probably for the same reasons that the JSTL EG made their decision. What do you think? -- Martin Cooper > > > -- > > =================================================================== > > David M. Karr ; Java/J2EE/XML/Unix/C++ > > [EMAIL PROTECTED] > > > > Craig > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>