struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <>
Subject How to avoid a scriplet and make this cleaner?
Date Tue, 02 Jul 2002 02:22:29 GMT
For this example I have an ArrayList of "cars" (which are CarBeans
with String carName, int id ). I want to iterate over this ArrayList
and set up each car name with a checbox next to it with the id as the
value. My FormBean has the property String[] carID to get the cars

The problem is I can't seem to avoid using a scriplet and can't seem
to use the checkbox tag to set up the following:

<logic:iterate id="element" name="cars" >
    <TD><bean:write name="element" property="carName"/></TD>
      <input type="checkbox" name="carID" value="<%= ((CarBean)element).getId() %>"/>

I want to avoid having to use the scriplet for the value above. I also
get errors when I try to use the tag for the checkbox with the

<html:checkbox property="carID" value="<%= ((CarBean)element).getId() %>" />

Any ideas how I can make the above code cleaner and/or get the
checkbox tag to work?




To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message