<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*;" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生管理系统</title>
</head>
<%! String url,sql;%>
<%! Connection conn;%>
<%! ResultSet rs;%>
<%! int i;%>
<body bgcolor="#FFFFFF">
<div align="center"><font color="#000000" size="+5">学生管理系统</font></div>
<table width="75%" border="1" cellpadding="1" cellspacing="1" align="center">
<tr>
<td width="16%" align=center>学号</td>
<td width="16%" align=center>姓名</td>
<td width="8%" align=center>性别</td>
<td width="8%" align=center>年龄</td>
<td width="16%" align=center>籍贯</td>
<td width="12%" align=center>院系</td>
<td width="12%" align=center>修改</td>
<td width="12%" align=center>删除</td>
</tr>
<%
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
url="jdbc:microsoft:sqlserver://localhost:1433;
DatabaseName=university";
conn=DriverManger.getConnection(url,"admin","123456");
stmt=conn.createStatement();
sql="select * from student";
rs=stmt.executeQuery(sql);
while(rs.next()){
%>
<tr>
<td width="16%" align="center" <%=rs.getObject(1)%> </td>
<td width="16%" align="center" <%=rs.getObject(2)%> </td>
<td width="8%" align="center" <%=rs.getObject(3)%> </td>
<td width="8%" align="center" <%=rs.getObject(4)%> </td>
<td width="16%" align="center" <%=rs.getObject(5)%> </td>
<td width="12%" align="center" <%=rs.getObject(6)%> </td>
<td width=12% align=center><ahref="change.jsp?xuehao=<%=rs.Object(1)%>">修改</a></td>
<td width=12% align=center><ahref="del.jsp?xuehao=<%=rs.Object(1)%>">删除</a></td>
</tr>
<%
}
rs.close();
stmt.close();
conn.close();
}catch(Exception e){
out.println(e);}
%>
</table>
<div align="center"><a href="insert.jsp">添加新记录</a></div>
</body>
</html>
An error occurred at line: 25 in the jsp file: /list.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: 25 in the jsp file: /list.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:414)
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.17 logs.