How to iterate ArrayList of String.
Suppose you have an ArrayList which contains only String. Many times the situation comes that ArrayList contains object of EMP class. or object of City and Stage. In this case iterating using logic:iterate is very easy. But if you want to iterate ArrayList of String then create combobox then it is difficult.
--------------------------
--------------------------
ArrayList myArrayList = new ArrayList();
myArrayList.add("Anil");
myArrayList.add("Saurabh");
myArrayList.add("Eshwar");
myArrayList.add("Sudeepta");
In jsp you can following lines of struts tag library.
<td align="left"> <b>Table Combobox</b>
<html:select styleId="tableName" property="tableName" value="aName" onchange="">
<option value=''>Select Table</option>
<html:options name="tableNameArrayList" />
</html:select>
</td>
Suppose you have an ArrayList which contains only String. Many times the situation comes that ArrayList contains object of EMP class. or object of City and Stage. In this case iterating using logic:iterate is very easy. But if you want to iterate ArrayList of String then create combobox then it is difficult.
--------------------------
--------------------------
ArrayList myArrayList = new ArrayList();
myArrayList.add("Anil");
myArrayList.add("Saurabh");
myArrayList.add("Eshwar");
myArrayList.add("Sudeepta");
In jsp you can following lines of struts tag library.
<td align="left"> <b>Table Combobox</b>
<html:select styleId="tableName" property="tableName" value="aName" onchange="">
<option value=''>Select Table</option>
<html:options name="tableNameArrayList" />
</html:select>
</td>
Where 1) tableName is one attribute in actionFormBean. When user select any value from combobox, on form submit tableName attribut will be populated.
2) tableNameArrayList , List of String which will be shown in comboBox.