我有下面的代碼來顯示一個列表給用戶選擇一個選項,它正確地顯示了列表選項,但是當一個選項被選中並且表單被提交時,它會出現以下錯誤。如何提交下拉列表的選定選項?
錯誤
Caused by: tag 'select', field 'list', name 'developerID': The requested list key
'listOfdevelopers' could not be resolved as a collection/array/map/enumeration/iterator type.
Example: people or people.{name} - [unknown location]
JSP
<s:form ...>
<s:select name="developerID"
label="developerID"
list="listOfdevelopers"
value="%{development.developerID}"
/>
</s:form>
我的代碼
....
private Map listOfdevelopers;
private Development development = new Development();
public Map getListOfdevelopers() {
return listOfdevelopers;
}
public void setListOfdevelopers(Map listOfdevelopers) {
this.listOfdevelopers = listOfdevelopers;
}
public Development getDevelopment() {
return development;
}
public void setDevelopment(Development development) {
this.development = development;
}
@Override
public Development getModel() {
return this.development;
}
...
你是不是在提交填充地圖。 – 2013-03-13 11:03:06
有沒有代碼在哪裏填充集合? – 2013-03-13 18:01:01
@Daniel Morgan可以顯示struts.xml – PSR 2013-03-14 07:00:39