日期:2014-05-18 浏览次数:20701 次
HttpServletResponse response = ServletActionContext.getResponse();
response.setCharacterEncoding("UTF-8");
try {
JSONArray result=JSONArray.fromObject(hashMap);
response.getWriter().write(result.toString());
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
Struts.xml
<action name="loadByCalltor" class="com.web.hg.action.CalltorAction" method="loadByCalltor">
<result name="success">/pageJSP/cmonitor.jsp</result>
xx.jsp
<c:forEach items="${hashMap}" var="map">
<c:out value="${map.key}" />
<c:out value="${map.value}" />
</c:forEach>
</action>
<s:iterator value="testlist" var="testmap">
<s:iterator value="testmap">
<s:property value="key" />
<s:property value="value" />
</s:iterator>
</s:iterator>