How to populate a drop down using string array list

Struts 1.x :
How to populate a dropdown using string array list?
In the form bean (formbean) there are getter and setter methods for the list “blockIds” which is an string arraylist. For an example

ArrayList<String> blockIds = new ArrayList<String>();

What would be the jsp code which should look like the following after rendering.

<select name=“selectedItem”>
    <option value=“A”>A</option>
    <option value=“B”>B</option>

Source: jsp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.