struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdullah Jibaly" <Abdullah.Jib...@aeroxchange.com>
Subject RE: <html:options> tag usage?
Date Tue, 28 Jun 2005 18:24:42 GMT
Using Servlet/JSP 2.4/2.0 and JSTL something like this should work:

<jsp:useBean id="myUtilBean" class="MyUtilBean"/>
<html:select property="...">
	<c:forEach items="${myUtilBean}" var="row">
		<html:option value="${row.name}">${row.value}</html:option>
	</c:forEach>
</html:select>

-----Original Message-----
From: Thai Dang Vu [mailto:TVu@dhmh.state.md.us]
Sent: Tuesday, June 28, 2005 1:08 PM
To: user@struts.apache.org
Subject: <html:options> tag usage?


Hello everybody,
 
This is a part of my input.jsp file:
 
<jsp:useBean id="myUtilBean" class="MyUtilBean"/>
.......
 
 
class MyUtilBean {
    private Collection c;
    public Collection getC() {
        c = new ArrayList();
        c.add(new DataBean("value", "name"));
        c.add(new DataBean("value1", "name1"));
        c.add(new DataBean("value2", "name2"));
        return c;
    }
}
.........................

class DataBean {
    private String name;
    private String value;
    // getter and setter methods
....
}

How could I write the <html:options> tag in the input.jsp file so that the jsp file
produces

<select name="...">
   <option value="name">value</option>
   <option value="name1">value1</option>
   <option value="name2">value2</option>
</select>

Thanks so much.


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


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


Mime
View raw message