日期:2014-05-18  浏览次数:20628 次

Tomcat测试JSP页面错误
HTTP   Status   500   -  

--------------------------------------------

type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP:  

An   error   occurred   at   line:   10   in   the   jsp   file:   /first.jsp
Syntax   error,   insert   "Finally "   to   complete   TryStatement
7:   while(rs.next())   {%>  
8:   您的第一个字段内容为: <%=rs.getString(1)%>   <br>
9:   您的第二个字段内容为: <%=rs.getString(2)%>   <br>
10:   <%}%>  
11:   <%out.print( "数据库操作成功 ");%>  
12:   <%
13:   rs.close();  
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.23   logs.


--------------------------------------------

Apache   Tomcat/5.5.23


高手分析下什么问题

------解决方案--------------------
An error occurred at line: 10 in the jsp file: /first.jsp
Syntax error, insert "Finally " to complete TryStatement

這個錯誤好像說的很明白,叫你在查詢數據庫是用try-catch-finally結構來做異常處理。
------解决方案--------------------
你的SQL语句错了,应该是从表about中查数据。而且建立数据库连接,执行数据库操作时会抛出异常,操作数据库的部分是不是要try/catch一下?
------解决方案--------------------
楼上正解
应该是 "select * from about "
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html