- In action, call dao or other helper method to retrieve data for dropdown list
- put the data (list/collection/array) to request or formbean property
- request.setAttribute("cityList", cityHelper.getAllCityLabelValueBean());
- cityListProperty = cityHelper.getAllCityLabelValueBean();
- In JSP
- for request
<html:form action="xxx">
<html:select property="city">
<html:optionsCollection name="dpList" label="label" value="value"/>
OR
<html:options collection="dpList" labelProperty="label" property="value"/>
</html:select>
</html:form>
</html:form>
- for property of formbean
<html:form action="xxx">
<html:select property="city">
<html:optionsCollection property="cityListProperty" label="label" value="value"/>
</html:select>
</html:form>