jsp el表达式解析嵌套集合对象(多层list,map嵌套),基于struts

action中对象

1 private List<PerforSalaryBase> cityBaseDetails

bean对象

 1 public class PerforSalaryBase extends AbstractPersistencePaymentObject {
 2 
 3     private static final long serialVersionUID = -134052330509224847L;
 4 
 5     private Long orgUnitId = null;
 6     
 7     private String payStdItem = null;
 8     
 9     private String perforLevel = null;
10     
11     private BigDecimal payStandard = null;
12     
13     private String remark = null;
14 
15     private Map<String, String> levelMap = new HashMap<String, String>();
16     
17 }

jsp页面解析

 1 <c:forEach items="${placesType_base}" var="placeType" varStatus="rowStatus">    <!--set集合-->
 2     <tr>
 3         <td width="100">
 4             ${placeType.codeName}
 5             <input type="hidden" name="cityBaseDetails[${rowStatus.index}].orgUnitId" value="${perforSalaryForm.queryParameterMap.countyId}">
 6         <input type="hidden" name="cityBaseDetails[${rowStatus.index}].payStdItem" value="${placeType.codeValue}">
 7         <c:set var="rowIndex" value="${rowStatus.index}"></c:set>
 8         </td>
 9         <c:forEach items="${level_base}" var="level" varStatus="colStatus">
10         <td>
11             <c:set var="levelValue" value="${level.codeValue}"></c:set>
12             <input type="text" class="textfield11" name="cityBaseDetails[${rowStatus.index}].levelMap.${level.codeValue}" onKeyPress="onlyDigital(this);" onBlur="checkMoney(this);" value="<c:choose><c:when test="${null==perforSalaryForm.cityBaseDetails[rowIndex].levelMap[levelValue]}">${rowIndex}.${levelValue}</c:when><c:otherwise><fmt:formatNumber type="number" pattern="0.00" value="${perforSalaryForm.cityBaseDetails[rowIndex].levelMap[levelValue]}"/></c:otherwise></c:choose>"  />
13         </td>
14         </c:forEach>
15     </tr>
16 </c:forEach>

 

 

posted on 2013-12-26 10:39  看天空的星星  阅读(2720)  评论(0编辑  收藏  举报

导航