hi ,
I am new to
struts i am stuck on an issue in the code of my project as part of that
i need to populate an Arraylist elements into an html option in the
JSP i mean a drop down
with value and label being the same as option value.
My ActionClass Contains
i am assigining in the following way in to my bean in one of my previous action class
ArrayList alist = new ArrayList();
for (int i=1;i<=30;i++)
{
alist.add(i);
}
atdForm.setAtDate(alist);
my ActionForm contains the below contents
ArrayList atDate = new ArrayList();
public ArrayList getAtDate()
{
return atDate;
}
public void setAtDate(ArrayList altDate)
{
this.atdate = altDate;
}
So now i am trying to generate a DropDown in my jsp
<logic:iterate id="element" name="AtdAForm" property="atdate">
<html:select property="selList">
<html:option name="dateList" value="<bean:write name="element"/>"><bean:write name="element"/></html:option>
</logic:iterate>
But i am unable to generate the desired result , i am not sure i am coding in the correct way , or can suggest the best way .Appreciate your help. Thanks.