chaxun.jsp
Generated servlet error:
String literal is not properly closed by a double-quote
这一句说你的这个chaxun.jsp文件第九行声明的字符串少了一个反双引号,你自己仔细看看!

解决方案 »

  1.   

    //String literal is not properly closed by a double-quote写在1行Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/testwxz?user = wxz & password = 123456");
      

  2.   

    Class.forName( "org.gjt.mm.mysql.Driver" ); 
    cn = DriverManager.getConnection( "jdbc:mysql://127.0.0.1:3306/DatabaseName=", sUsr, sPwd ); 
    你的驱动是不是写错了
      

  3.   

    八百里是正解,但是又有新的问题:
    HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 9 in the jsp file: /chaxun.jsp
    Generated servlet error:
    conn cannot be resolvedAn error occurred at line: 9 in the jsp file: /chaxun.jsp
    Generated servlet error:
    conn cannot be resolved
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    --------------------------------------------------------------------------------Apache Tomcat/5.5.9
      

  4.   

    作用域
    Connection conn=null;
    定义在try前面