后台代码 List一个放了一个Map
public List<LocationInfo> getPubwinconfigDate(Pagination pagination,String serviceCode){
List<LocationInfo> loctionList = this.locationdao.getPubwinconfigDate(pagination,serviceCode);
for (Iterator iterator = loctionList.iterator(); iterator.hasNext();) {
LocationInfo locationInfo = (LocationInfo) iterator.next();
Map<String,String> mapLocation = this.locationdao.getPubwinConfig(locationInfo.getLocation_code());
locationInfo.setPubwinMap(mapLocation);
}
return loctionList;
}
Action放入request里面
String serviceCode = request.getParameter("serviceCode");
List listPubwin = locationService.getPubwinconfigDate(pagination,serviceCode);
request.setAttribute("listPubwin", listPubwin);
JSP用struts2遍历 LIst -》map 的value
<s:iterator id="rs" value="#request.listPubwin" status="stat">
<tr>
<td> <div class="tb_h"> <s:property value="#rs.location_code"/> </div></td>
<td> <div class="tb_h"> <s:property value="#rs.service_name"/> </div></td>
<td> <div class="tb_h"> <s:property value="#rs.pubwinMap.get('dupCertIDTimes')"/> </div></td>
<td> <div class="tb_h"> <s:property value="#rs.pubwinMap.get('nonCertIDRatio')"/> </div></td>
<%-- <td> <div class="tb_h"> <s:property value="#rs.pubwinMap.get('mobileLogin_Switch_tm')"/> </div></td> --%>
</tr>
</s:iterator>