HTTP Status 500 - Unable to compile class for JSP:
type Exception report
message Unable to compile class for JSP:
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: 19 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved16: //获取到登录用户的学号17: String studentNumber = request.getParameter("login");18: //注册数据库驱动19: Connection conn1 = Connectdb.getConnection();20: PreparedStatement pstmt1 = null;21: ResultSet rs1 = null;22: String sql1 = "SELECT studentName FROM Students WHERE studentNumber = ?";An error occurred at line: 43 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved40: catch(SQLException e){41: e.printStackTrace();42: }finally{43: Connectdb.closeJDBC(rs1, pstmt1, conn1);44: } 45: %>46: An error occurred at line: 57 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved54: 55: </tr>56: <%57: Connection conn = Connectdb.getConnection();58: PreparedStatement pstmt = null;59: ResultSet rs = null;60: String sql = "SELECT Course.*,SC.scord FROM Course,SC WHERE SC.studentNumber = ? AND Course.courseNumber=SC.courseNumber";An error occurred at line: 82 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved79: catch(SQLException e){80: e.printStackTrace();81: }finally{82: Connectdb.closeJDBC(rs, pstmt, conn);83: } 84: %>85: </table>Stacktrace:org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)loginServlet.doPost(loginServlet.java:41)javax.servlet.http.HttpServlet.service(HttpServlet.java:648)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.28 logs.
Apache Tomcat/8.0.28
type Exception report
message Unable to compile class for JSP:
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: 19 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved16: //获取到登录用户的学号17: String studentNumber = request.getParameter("login");18: //注册数据库驱动19: Connection conn1 = Connectdb.getConnection();20: PreparedStatement pstmt1 = null;21: ResultSet rs1 = null;22: String sql1 = "SELECT studentName FROM Students WHERE studentNumber = ?";An error occurred at line: 43 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved40: catch(SQLException e){41: e.printStackTrace();42: }finally{43: Connectdb.closeJDBC(rs1, pstmt1, conn1);44: } 45: %>46: An error occurred at line: 57 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved54: 55: </tr>56: <%57: Connection conn = Connectdb.getConnection();58: PreparedStatement pstmt = null;59: ResultSet rs = null;60: String sql = "SELECT Course.*,SC.scord FROM Course,SC WHERE SC.studentNumber = ? AND Course.courseNumber=SC.courseNumber";An error occurred at line: 82 in the jsp file: /jsp/studentinfo.jspConnectdb cannot be resolved79: catch(SQLException e){80: e.printStackTrace();81: }finally{82: Connectdb.closeJDBC(rs, pstmt, conn);83: } 84: %>85: </table>Stacktrace:org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)loginServlet.doPost(loginServlet.java:41)javax.servlet.http.HttpServlet.service(HttpServlet.java:648)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.28 logs.
Apache Tomcat/8.0.28