0
我已將Hahmap分配給下拉列表。每個下拉列表將被設置爲hashmap。當我嘗試獲取這些值時,我將值作爲字符串數組而不是一個對象。因此,如果驗證失敗,我無法重新填充值。下面是我使用的代碼來填充值的 。在struts2中返回字符串數組而不是整數對象的映射屬性
<s:iterator value="#actComments.lstEntities">
<tr>
<td width="15%" align="left"><s:textfield name="propType"
readonly="true" value="%{#attr.propertyTypeName}"
cssStyle="width:80px;font-size:11px;" /></td>
<td width="85%" align="left"><s:select
name="hmMapComment[%{#attr.propertyTypeId}]"
cssStyle="font-size:11px;width:457px;margin-bottom:3px"
headerKey="0" headerValue="-- Select Comment --" list="comments"
listKey="commentId" listValue="commentText" /></td>
</tr>
</s:iterator>
嗨,我使用的是JDK1.4。所以我不能使用泛型。我需要在哪裏聲明它?我是否需要使用類似轉換的內容。如果是的話如何使用它? – Jothi 2010-08-12 05:37:48