新学生,老错误!!急!
代码:
<%@ page contentType= "text/html; charset=gb2312 " language= "java " import= "java.sql.*,java.util.* "
errorPage= " " %>
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<body>
<%! String yewu,shijian,dishi,day_zeng,day_jian,day_jingzeng,zaiwang;%>
<%! Connection conn;%>
<%! ResultSet rs;%>
<%
yewu=request.getParameter( "yewu ").trim();
shijian=request.getParameter( "shijian ").trim();
dishi=request.getParameter( "dishi ").trim();
dishi=new String(dishi.getBytes( "ISO-8859-1 "));
day_zeng=request.getParameter( "day_zeng ").trim();
day_jian=request.getParameter( "day_jian ").trim();
day_jingzeng=request.getParameter( "day_jingzeng ").trim();
zaiwang=request.getParameter( "zaiwang ").trim();
try
{
Class.forName( "oracle.jdbc.driver.OracleDriver ").newInstance();
String url= "jdbc:oracle:thin:@localhost:1521:sd ";
String user= "wyf ";
String password= "wyf ";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql= "insert into yewu(yewu,shijian,dishi,day_zeng,day_jian,day_jingzeng,zaiwang) ";
sql=sql+ "values( ' "+yewu+ " ', ' "+shijian+ " ', ' "+dishi+ " ', ' "+day_zeng+ " ', ' "+day_jian+ " ', ' "+day_jingzeng+ " ', ' "+zaiwang+ " ') ";
stmt.executeQuery(sql);
rs.close();
stmt.close();
conn.close();
}
catch(Exception e){
response.sendRedirect( "err.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
Generated servlet error:
Syntax error on tokens, delete these tokens
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(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.
刚刚写了一段代码,希望大家指点上