当前位置: 技术问答>java相关
JSP页面中数据集出错的问题
来源: 互联网 发布时间:2017-05-01
本文导语: 在我的JSP页面中有下面的一段代码 -------------------- 字数 回帖数 -------------------- 其中,点击不同的链接,“...
在我的JSP页面中有下面的一段代码
--------------------
字数
回帖数
--------------------
其中,点击不同的链接,“forumid”值不同,从而对应数据库中有的有数据,有的就没有数据。当没有数据的时候,显示正常;当有数据的时候,不能正常显示数据,错提示如下:
---------------
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: No data found
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:481)
at Front._0002fFront_0002fbbsdisplay_0002ejspbbsdisplay_jsp_11._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:464)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContext.invoke(Compiled Code)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.valves.AccessLogValve.invoke(Compiled Code)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.process(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
Root Cause:
java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:4270)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Compiled Code)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Compiled Code)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Compiled Code)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:241)
at Front._0002fFront_0002fbbsdisplay_0002ejspbbsdisplay_jsp_11._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:464)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContext.invoke(Compiled Code)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.valves.AccessLogValve.invoke(Compiled Code)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.process(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
---------------------------
请高手给予诊断。
谢谢!!
--------------------
字数
回帖数
--------------------
其中,点击不同的链接,“forumid”值不同,从而对应数据库中有的有数据,有的就没有数据。当没有数据的时候,显示正常;当有数据的时候,不能正常显示数据,错提示如下:
---------------
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: No data found
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:481)
at Front._0002fFront_0002fbbsdisplay_0002ejspbbsdisplay_jsp_11._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:464)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContext.invoke(Compiled Code)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.valves.AccessLogValve.invoke(Compiled Code)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.process(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
Root Cause:
java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:4270)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Compiled Code)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Compiled Code)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Compiled Code)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:241)
at Front._0002fFront_0002fbbsdisplay_0002ejspbbsdisplay_jsp_11._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:464)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardContext.invoke(Compiled Code)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.valves.ValveBase.invokeNext(Compiled Code)
at org.apache.catalina.valves.AccessLogValve.invoke(Compiled Code)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.process(Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
---------------------------
请高手给予诊断。
谢谢!!
|
字数
回帖数
ForumResult.getString("id")有错误,有些驱动程序getString("id")只能执行一次。