由于EL表达式不支持循环输出Map中的值,所以要循环遍历Map的话就必须使用JSTL
这是Map对应的action
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map map = new HashMap();
map.put("k1", "冯江红,你可笑了");
map.put("k2", "想不到你也有今天");
map.put("k3", "这就是苦的滋味,尝到了吗");
request.setAttribute("maps", map);
return mapping.findForward("success");
}
......
阅读全文