关于jsp的问题,String literal is not properly closed by a double-quote

来源:百度知道 编辑:UC知道 时间:2024/05/07 02:25:51
具体的错误如下

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

An error occurred at line: 57 in the jsp file: /resuccess.jsp
String literal is not properly closed by a double-quote
54: Connection conn=DriverManager.getConnection(url,name,password);
55: Statement stmt = conn.createStatement();
56:
57: stmt.executeUpdate("INSERT INTO info(username,email,tel,idcard,postcard,addr,degree,major,english,
58: hobby,good,job,project,practice,course,assessment)
59: VALUES ('"+str1+"','"+str2+"','"+str3+"','"+str4+"','"+str5+"','"+str6+"','"+str7+"','"+str8+"','"+str9+"',
60: '"+str10+"','"+str11+"','"+str12+"','"+str13+"','"+str14+"&

看错误提示本身貌似是字符串双引号有问题,例如不能成对匹配之类的……

VALUES ('"+str1+"','"+str2+"','"+str3+"','"+str4+"','"+str5+"','"+str6+"','"+str7+"','"+str8+"','"+str9+"',
60: '"+str10+"','"+str11+"','"+str12+"','"+str13+"','"+str14+"','"+str15+"','"+str15+"')";

你发的语句最后多了个")"