struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Tab Libraries? Bah!
Date Wed, 24 Apr 2002 20:20:29 GMT
On Wed, 24 Apr 2002 Kevin.Bedell@sunlife.com wrote:

> Date: Wed, 24 Apr 2002 15:23:39 -0400
> From: Kevin.Bedell@sunlife.com
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> Subject: Re: Tab Libraries? Bah!
>
>
>
>
> I've come to the following conclusions:
>
>  - If Struts tries "to take the programmer out of the equation" completely,
> it will become an inferior solution.
>
>  - Other page development languages (Cold Fusion, ASP, JSP even) provide
> actual scripting languages with:
>      - Variable definition
>      - String manipulation functions
>      - Looping constructs that don't need to be tied to objects (or
> collections in objects)
>      - Other things that give the page developer power to create dynamic
> pages
>
> I don't believe that Struts can (or should, really) provide all these
> things. Yet these things become very handy when building dynamic pages.
>
> If you tell a page developer (and I have) that they need to leave one of
> the more powerful development languages that I described to use Struts,
> there are problems:
>
>  - The page developer has less flexibility than they used to have
>  - The page developer can contribute less to the project - they are used to
> having a more powerful language.
>
> So the only answer I can practically think of is to still allow some
> mixture of scriptlets. I think eliminating them all is a mistake - I tried
> it.
>
> So then, the real question is how - or where - do you draw the line?
>
> Asking page designers to become Java programmers is a problem. Giving them
> only Struts is a problem.
>
> Where is the middle ground?
>

Personally, I don't have much problem with using runtime expressions in
JSP pages when they are useful to calculate dynamic values.  However, they
still tie you to understanding the underlying nature of the Java objects
you are accessing.  The expression language in the Java Standard Tag
Library (JSTL) beta-2 release, available at
<http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html>, which
will also be added to JSP 1.3, addresses these concerns -- and is the
right long term direction, IMHO.  I plan to add similar capabilities to
Struts tags (in some future version) to assist in migration.

> <html:select property="ccExpYear" styleId="ccExpYear">
>   <html:option value="0">Year</html:option>
>   <logic:iterate id="expYear" name="listExpYears" scope="session">
>     <html:option value="<%= ( String) expYear %>">
>        <%= expYear %>
>     </html:option>
>   </logic:iterate>
> </html:select>

As others have pointed out, the <html:options> can also be used here to
avoid the loop.


> FWIW -
> Kevin
>

Craig


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message