tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@wamu.net>
Subject RE: how to do this with JSTL
Date Mon, 25 Jul 2005 22:50:37 GMT
Hold on there.  I think you've misunderstood the intent of integrating
JSTL with Struts.

The idea is not to replace all Struts tags with JSTL tags.  That's not
practical.  In general, you should look at the functionality available
in the JSTL.  If there's something that the JSTL does, and there's a
similar tag in Struts, then just use the JSTL tag.  However, any of the
"html" tags in Struts cannot be easily replaced with a JSTL tag.

You should, however, look at using the "Struts-EL" tags instead of the
Struts tags.  This will allow you to use the expression language in
attribute values, as opposed to using scriptlets.

In the example you provide here, you would want to have a "setup action"
which places certain "constant" values into your application or session
context, resulting in something like this:

  <html:options collection="${expenseTypes}" property="id"
labelProperty="description"/>

> -----Original Message-----
> From: Marco Mistroni [mailto:mmistroni@gmail.com] 
> Sent: Monday, July 25, 2005 12:08 PM
> To: Tag Libraries Users List
> Subject: how to do this with JSTL
> 
> 
> hello all,
>   i am trying to port my application from using struts tag 
> towards using JSTL tags, but i got stuck in a point where i 
> have to display a selectable list.. below was the original 
> struts code..
> 
> <html:select name="entry" property="type" >
>         	<html:options collection="<%= 
> Constants.EXPENSE_TYPES%>" property="id" labelProperty="description"/>
>       			</html:select>
> 
> Basically,thi swill lproduce a selectable list where the 
> selected value is the one corresponding to thep roperty..
> 
> am i correct that, if i want ot use JSTL, i have to use  a 
> c:forEach for displaying the collection, and a c:if to test 
> teh value for each value in teh collection?
> 
> anyone can give any hints?
> 
> thanx and regards
>   marco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message