1.
jsp: works fine
<s:form id="createAccountForm" namespace="/accounts"
action="CreateAccount" method="post">
<td><div
class="input-container">
<s:select
label="Business" name="business" id="business"
headerKey="1"
headerValue="Select Business"
list="#{'111':'Food
& Drink- Restaurants/Pubs'}" />
</div></td>
2. jsp: errors out
<td><div
class="input-container">
<s:select
label="Business" name="business" id="business"
headerKey="1"
headerValue="Select Business"
list="businesses"
/>
</div></td>
3. Error:
org.apache.jasper.JasperException: tag 'select', field 'list', name 'business': The requested list key 'businesses' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
4. CreateAccountAction has the following code:
Map<Long,
String> businesses = new HashMap<Long, String>();
public Map<Long, String> getBusinesses() {
return services.getBusinesses();
}
public void setBusinesses(Map<Long, String> businesses) {
this.businesses = businesses;
services.setBusinesses(businesses);
}
5. Services has the following code:
public Map<Long, String> getBusinesses() {
return businesses;
}
public void setBusinesses(Map<Long, String> businesses) {
this.businesses = businesses;
}
Map<Long, String> businesses = new HashMap<Long, String>();
6. struts.xml
<package name="accounts" namespace="/accounts" extends="struts-default">
<action name="CreateAccount"
class="in.firm.bizz.actions.accounts.CreateAccountAction" >
<result>/search/results.jsp</result>
<result name="redirect" type="redirect">${redirectUrl}</result>
</action>
</package>
If would be good if someone could share from his experience what am I missing..