首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

javax.servlet.jsp.JspTagException: begin (1) > end (0)解决思路

2013-09-11 
javax.servlet.jsp.JspTagException: begin (1) end (0)org.apache.jasper.JasperException: An excepti

javax.servlet.jsp.JspTagException: begin (1) > end (0)
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/page/share/fenye.jsp at line 3

1: <%@ page language="java" pageEncoding="gbk"%>
2: <font color="#FFFFF" size="2">当前第 <b>${pageView.currentpage}</b> 页<b>|</b> 总共 <b>${pageView.totalrecord }</b> 条记录<b>|</b>每页显示 <b>${pageView.maxresult }</b> 条<b>|</b>总共 <b>${pageView.totalpage }</b> 页</font>
3: <c:forEach begin="${pageView.pageindex.startindex}" end="${pageView.pageindex.endindex}" var="wp">
4: <c:if test="${pageView.currentpage==wp}"><b><font color="#FFFFF" size="2">第${wp}页</font></b> </c:if>
5: <c:if test="${pageView.currentpage!=wp}"> <a href="javascript:topage('${wp}')" class="a03"><font color="#FFFFF" size="2">第${wp}页</font> </a></c:if>
6: </c:forEach>

严重: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspTagException: begin (1) > end (0)
at javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:253)
at org.apache.jsp.WEB_002dINF.page.newsentity.newstypelist_jsp._jspx_meth_c_005fforEach_005f0(newstypelist_jsp.java:315)
at org.apache.jsp.WEB_002dINF.page.newsentity.newstypelist_jsp._jspx_meth_html_005fform_005f0(newstypelist_jsp.java:172)
at org.apache.jsp.WEB_002dINF.page.newsentity.newstypelist_jsp._jspService(newstypelist_jsp.java:109)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1078)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:396)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.iwtxokhtd.news.web.filter.SetEncodingFilter.doFilter(SetEncodingFilter.java:23)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)


at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)


分页代码已经上面了,请问当数据没有查到时,jstl标签为什么会报这样的异常?没有数据时,应该打印为0呀!
该如何解决上面的异常,请高手赐教


[解决办法]
看看${pageView.pageindex.startindex}和${pageView.pageindex.endindex}这两个值

[解决办法]
循环之前先判断是否有数据,
我的异常网推荐解决方案:An exception occurred processing JSP page,http://www.myexception.cn/j2se/33144.html

热点排行