<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.lang.Math.*" %>
<jsp:useBean id="conn" scope="page" class="download.conn"/>
<html>
<head>
<title>网上书店</title>
<link href="incoming/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
String userid =request.getParameter("useid");
String password = request.Parameter("password");
String username = request.getParameter("username");
String address = request.getParameter("address");
String phone =request.getParameter("phone");
String email = request.getParameter("email");
String sql="INSERT INTO BUYERINFO
VALUES('"+userid+"','"+password+",'"+username+"','"+address+"','"+phone+"','"+email+"')";
conn.executeUpdate(sql);
%>
<br><a class="title">已经注册成功!请<a href="login.jsp">登录</a></a><br>
<%@ include file="incoming/footer.jsp"%>
</body>
</html>
小弟用上面的代码想往数据库中插入数据,可是每次都显示下面的错误:
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: 13 in the jsp file: /ruanjianxiazai/adduser.jsp Generated servlet error: String literal is not properly closed by a double-quote org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 13 in the jsp file: /ruanjianxiazai/adduser.jsp Generated servlet error: String literal is not properly closed by a double-quote 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:409) org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) 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.15 logs.
Apache Tomcat/5.5.15
希望有人能救下我,谢谢了