jsp页面上使用jstl的foreach时报错 5
恳请各位朋友们帮忙啊!报错信息如下:org.apache.jasper.JasperException:UnabletocompileclassforJSP:Anerro...
恳请各位朋友们帮忙啊!
报错信息如下:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 16 in the jsp file: /amobjectamin/test.jsp
The type Class is not generic; it cannot be parameterized with arguments <?>
13:
14: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15:
16: <c:forEach var="item" items="${contents}" varStatus="status">
17: <tr>
18: <c:if test="${status.count%2==0}">bgcolor="#CCCCFE"</c:if>
19: align="left"> xxx
整个jsp页面的代码:
<%@ page language="java" pageEncoding="GBK"
contentType="text/html;charset=GBK" isELIgnored="false"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested"%>
<%@ page isELIgnored="false"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<c:forEach var="item" items="${contents}" varStatus="status">
<tr>
<c:if test="${status.count%2==0}">bgcolor="#CCCCFE"</c:if>
align="left"> xxx
</tr>
</c:forEach> 展开
报错信息如下:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 16 in the jsp file: /amobjectamin/test.jsp
The type Class is not generic; it cannot be parameterized with arguments <?>
13:
14: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15:
16: <c:forEach var="item" items="${contents}" varStatus="status">
17: <tr>
18: <c:if test="${status.count%2==0}">bgcolor="#CCCCFE"</c:if>
19: align="left"> xxx
整个jsp页面的代码:
<%@ page language="java" pageEncoding="GBK"
contentType="text/html;charset=GBK" isELIgnored="false"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested"%>
<%@ page isELIgnored="false"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<c:forEach var="item" items="${contents}" varStatus="status">
<tr>
<c:if test="${status.count%2==0}">bgcolor="#CCCCFE"</c:if>
align="left"> xxx
</tr>
</c:forEach> 展开
3个回答
展开全部
<c:forEach var="item" items="${contents}" varStatus="status"><table><tr <c:if test="${status.count%2==0}"> bgcolor="#CCCCFE" </c:if>><td>内容</td></tr></table></c:forEach>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<c:forEach var="item" items="${contents}" var="status">
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询