2010-08-04 83 views
2

在此之前,我已經成功地使用了struts 2選擇標記,但是現在我遇到了一個問題,我的jsp由於select標記而拋出異常,我創建了一個數組列表,我傳遞給select標籤的'list'屬性,我還爲該列表定義了getters & setter,並且還爲select標籤的name屬性元素定義了一些I選項,新創建。選擇標記不在Jsp上渲染

org.apache.jasper.JasperException: tag 'select', field 'list', name 'division': 
The requested list key 'divisionList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] 

請幫助提前致謝。

+2

我們可以看到一些代碼嗎? – naikus 2010-08-04 10:12:24

+0

這聽起來像您的ArrayList不在您的JSP頁面的正確範圍內 - 如果您發佈了一些代碼,我們可以提供幫助。 – Pat 2010-08-04 11:47:52

+0

我的問題解決了先生,當我通過在我的Eclipse編輯器中轉到「Source」菜單創建getter/setter並選擇生成getters/setters時,會發生該問題,但是當我直接在屬性上使用快捷鍵控件+ 1創建getter/setter它給了我適當的輸出,聽起來很奇怪,但它是真實的。 – Jitendra 2010-08-04 12:01:31

回答

1

我在我的應用程序中成功使用了這個選擇標籤。沒有例外。更改正確的屬性名稱。如果這不能解決你的問題,那麼給我你的代碼和更多的描述。

<html:select style="width:192px" name="VForm" property="classificationName" > 
    <html:optionsCollection property="comboList"/> 
</html:select> 

感謝 伊姆蘭