How to use Combo box in
Struts 2?
I want to load Combo box from List Or Map .
I try to do it like this.
---------------------------------------jsp page-------------------------------------------------------
<% List<Country> countries = (List<Country>) request.getAttribute("countries"); %>
<s:set var="countryList"><%=countries%></s:set>
<s:select name="country" list="%{countryList}" label="Select a country" />
---------------------------------------output-----------------------------------------------------------
[Sri Lanka,India,USA]
But elements in 'countries' list object are not added to the combo box. 'toString' representation of List object is displayed in combo box.
How to add countries as element of the Combo box.