C 标签
这是我Struts中的重要代码。city中也有数据。
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
List<CityArea> city = cityAreaDao.search(1, null, null, null, null);
request.setAttribute("city", city);
return mapping.findForward("JS");
}
这个struts 跳转到JSP 以下是我JSP的重要代码
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="com.bafang.pojos.CityArea"%>
<body>
<c:forEach items="${city }" var="c">
${c.name }
</c:forEach><br/>
<%
List<CityArea> city =(List<CityArea>) request.getAttribute("city");
if(city!=null && city.size()>0)
{
for(CityArea c:city)
{
%>
<%=c.getName() %>
<%
}
}
%>
</body>
我在JSP里用脚本可以取得到数据,C标签取不到。为什么啊!帮帮忙!谢谢诶
这是我CityArea实体类里的字段
private Integer id;
private Integer subsiteId;
private Integer level;
private Integer parent;
private String name;