报错(Illegal use of <when>-style tag without <choose> as its direct parent)

来源:互联网 发布:cms stop the world 编辑:程序博客网 时间:2024/06/03 20:04

报错描述:javax.servlet.jsp.JspTagException: Illegal use of <when>-style tag without <choose> as its direct parent
分析发现:
使用jstl标签: 和 时必须同时使用使用
例如:

<c:forEach begin="1" end="${pageBean.totalPage }" var="i">    <c:choose>         <c:when test="${pageBean.pageNumber==i }">            <li class="active"><a>${i }</a></li>        </c:when>         <c:otherwise>            <li><a href="${pageContext.request.contextPath}/ProductServlet?method=findProductByCid4Page&pageNumber=${i}&cid=${param.cid}">${i }</a></li>        </c:otherwise>     </c:choose> </c:forEach>