下面是我的JSP页面代码,可是运行时出错了
<%@ page contentType="text/html; charset=GB2312"%>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>我的JSP</title>
</head>
<body>
<center><font size=4 color=blue>以下是范例</font>
</center>
<hr>
<br>
<center>
<%
Class.forname("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost/yqfang","root","");
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select * from test");
while(rs.next())
{
%>
<table bgcolor=DodgerBlue>
<tr bgcolor=LightGoldenrodYellow>
<td><b><%=rs.getString(1)%></b></td>
<td><b><%=rs.getString(2)%></b></td>
<td><b><%=rs.getString(3)%></b></td>
<td><b><%=rs.getString(4)%></b></td>
</tr>
<%
rs.close();
stmt.close();
conn.close();
%>
</table>
</center>
</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:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.23