读书人

struts2 s:iterator取包孕LIST的MAP

发布时间: 2012-09-17 12:06:52 作者: rapoo

struts2 s:iterator取包含LIST的MAP

?

private Map<String, List<String>> yearMonthMap = new HashMap<String, List<String>>();

List<String> strList = Lists.newArrayList();

strList.add("01");

strList.add("02");

strList.add("03");

yearMonthMap.put("2011", strList);

yearMonthMap.put("2012", strList);

?

?

<s:iterator value="yearMonthMap" id="yeargd">

<div style="margin:5px 0;">

<div style="padding-left:5px;">

<span id="showspan${yeargd.key}"><img onclick="showYearMonthDiv(${yeargd.key})" src="${ctx}/style/skin1/images/max_gray.jpg" alt="struts2 s:iterator取包孕LIST的MAP" /></span><span id="closespan${yeargd.key}" style="display:none;"><img onclick="closeYearMonthDiv(${yeargd.key})" src="${ctx}/style/skin1/images/min_gray.jpg" alt="struts2 s:iterator取包孕LIST的MAP" /></span>

<span><a href="${ctx}/memo/memo.action?currYearMonth=${yeargd.key}-01"><s:property value="#yeargd.key"/>年归档</a></span>

</div>

<div id="yearmonthdiv${yeargd.key}" style="display:none;padding-left:20px;border:1px gray dashed;">

<s:iterator value="#yeargd.value" id="monthgd">

<div><a href="${ctx}/memo/memo.action?currYearMonth=${yeargd.key}-${monthgd}&ifMonth=yes"><s:property value="#yeargd.key"/>年<s:property value="monthgd"/>月</a></div>

</s:iterator>

</div>

</div>

</s:iterator>

读书人网 >Web前端

热点推荐