就是连数据库的时候出现这种错误!!!!!运行了多个连数据库的程序都是这种错误这是其中一个源代码:
<%@page language=""java"%>
<%@page import="java.sql.*"%>
<%@page contentType="text/html;charset=""GB2312"%>
<html>
<head>
<title>修改记录(update)范例</title>
</head>
<body bgcolor="#FFFFFF">
<%
String driver="org.gjt.mm.mysql.Driver";
String url="jdbc:mysql://localhost:3306/mydata";
String user="root";
String password="123456";
try
{Class.forName(driver);
}
catch(Exception e)
{out.println("无法加载驱动程序:"+driver);
e.printStateTrace();
}
try
{Connection con=DriverManager.getConnection(url,user,password);
PreparedStatement psmt=con.prepareStatement("UPDATE phonebook"
+"set phone=?,addr=?"+"where name=?");
psmt.setString(1,"4561234");
psmt.setString(2,"高雄市前镇区");
psmt.setString(3,"陈小蓉");
psmt.executeUpdate();
psmt.close();
con.close();}
catch(SQLExcepiton se)
{se.printStackTrace();
}
%>
</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: /first.jsp(19,2) Unterminated <% tag
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:130)
org.apache.jasper.compiler.Parser.parseScriptlet(Parser.java:796)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1555)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
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.
--------------------------------------------------------------------------------
本人的运行环境为:
jdk-1_5_0_04+jakarta-tomcat-5.5.9+mysql-5.0.15-win32+mysql-connector-java-3.1.12.zip
各个环境变量都配置好啊!就是连数据库的时候出现这种错误!!!!!!!!!!!!
Tomcat/5.5.9 logs为:2006-4-21 13:31:17 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /ch7-03.jsp(1,24) equal symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:193)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:156)
at org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:434)
at org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:377)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:169)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source
--转自
该贴由koei123转至本版2015-2-5 17:25:20