用strust标签如何获取Map 具体某个键的值,就像map.get(key)
解决方案 »
- 求解:严重: action: null org.springframework.beans.factory.BeanCreationException
- 这种OA要咋做?你没见过的。
- ejb怎么发布到oas上??
- 一个java和java web的初学者应该看什么样的书?
- 动态Action的应用 报错Could not find action or result
- 在Windows 2000下如何配置JSP+Weblogic8.0
- [请教JDEVELOP关于ADF的问题!!]想制帮一个BROWSE页与DETAIL页的例子!
- 求一个JSP、XML和数据库交互的例子,在线等………………
- 为何jakarta-tomcat-5.0.25+oracle会在没有浏览网页一段时间后,就连不上数据库
- 初学者的一个问题,请多指教!
- 百思不得其解 int值相等的问题,求解释!
- struts2与ajax的全局异常错误处理问题
不过你可以试试,我将代码给你。。
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="testmap">
<s:property value="key" />
<s:property value="value" />
</s:iterator>
</s:iterator>
我记得应该是这样就可以了..