日期:2014-05-17  浏览次数:20824 次

The server encountered an internal error () that prevented it from fulfilling th
急求!!!!请各位大侠帮帮忙,错误!
type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperExceptionjava.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:426)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

java.lang.NullPointerException
org.apache.jsp.WebRoot.EnterPage.judge_jsp._jspService(judge_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.

源代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<%
String userName = request.getParameter("number");
String password = request.getParameter("password");
String str1 = null;
//out.println(userName);
Statement st = null;
Connection con = null;
ResultSet rs = null;
int i = 0;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:sun");
st = con.createStatement();
String sql = "select * from userInformation";
rs = st.executeQuery(sql);
while(rs.next()){
String str = rs.getString(2);
if(str.equals(userName) && str.equals(password))
{
str1 = str;
i ++;
}
}
if(i == 0)
{
String s = "您输入的用户名或密码错误";
String errorInfo = new String(s.getBytes("GB18030") , "ISO-8859-1");
response.sendRedirect("EnterPage.jsp?errorInfo=" + errorInfo);
}
else if(i == 1)
{
response.sendRedirect("/StudentSystem/TheMainPage/TheMainPage.jsp");
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLExcepti