You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yansheng Lin <ya...@isogis.com> on 2003/07/17 17:38:26 UTC
Ugly struts tag to JSTL transformation?
Hi I have to populate a drop down list with the following code. I am having
trouble converting it to JSTL. Note that I had to use a <bean:define> for the
collection to get this working. Didn't know any better at that time, I guess:).
<-------code-------->
<bean:define id="codes" name="manageCostForm" property="codes" />
<html:select property="item">
<html:options collection="codes" property="code"
labelProperty="codeAndDescription"/>
</html:select>
<-------/code-------->
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Ugly struts tag to JSTL transformation?
Posted by Yansheng Lin <ya...@isogis.com>.
Huh, it seems the struts way is more straight forward to me....
-----Original Message-----
From: Michael Duffy [mailto:duffymo@yahoo.com]
Sent: July 17, 2003 9:45 AM
To: Struts Users Mailing List
Subject: Re: Ugly struts tag to JSTL transformation?
Here's how I've done a drop-down in JSTL:
<jsp:useBean id="lineNumbers"
type="java.util.List"
scope="session"/>
<select name="print-line-number"
size="1"
title="Select a line number to print">
<c:forEach items="${lineNumbers}" var="lineNumber">
<c:choose>
<c:when test="${lineNumber == printLineNumber}">
<option selected="selected">
<c:out value="${lineNumber}"/></option>
</c:when>
<c:otherwise>
<option><c:out value="${lineNumber}"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
HTH - MOD
--- Yansheng Lin <ya...@isogis.com> wrote:
> Hi I have to populate a drop down list with the
> following code. I am having
> trouble converting it to JSTL. Note that I had to
> use a <bean:define> for the
> collection to get this working. Didn't know any
> better at that time, I guess:).
>
> <-------code-------->
> <bean:define id="codes" name="manageCostForm"
> property="codes" />
>
> <html:select property="item">
> <html:options collection="codes" property="code"
> labelProperty="codeAndDescription"/>
> </html:select>
> <-------/code-------->
>
> Thanks!
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Ugly struts tag to JSTL transformation?
Posted by Michael Duffy <du...@yahoo.com>.
Here's how I've done a drop-down in JSTL:
<jsp:useBean id="lineNumbers"
type="java.util.List"
scope="session"/>
<select name="print-line-number"
size="1"
title="Select a line number to print">
<c:forEach items="${lineNumbers}" var="lineNumber">
<c:choose>
<c:when test="${lineNumber == printLineNumber}">
<option selected="selected">
<c:out value="${lineNumber}"/></option>
</c:when>
<c:otherwise>
<option><c:out value="${lineNumber}"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
HTH - MOD
--- Yansheng Lin <ya...@isogis.com> wrote:
> Hi I have to populate a drop down list with the
> following code. I am having
> trouble converting it to JSTL. Note that I had to
> use a <bean:define> for the
> collection to get this working. Didn't know any
> better at that time, I guess:).
>
> <-------code-------->
> <bean:define id="codes" name="manageCostForm"
> property="codes" />
>
> <html:select property="item">
> <html:options collection="codes" property="code"
> labelProperty="codeAndDescription"/>
> </html:select>
> <-------/code-------->
>
> Thanks!
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org