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
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
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)
root cause
java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(login_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
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
原码如下
<meta http-equiv="refresh" content="1;url=default.htm">
<%@ page contentType="text/html; charset=gbk" %>
<%@ page language="java" import="java.sql.*"%>
<jsp:useBean id="j" scope="application" class="jdbc.jdbc"/>
<jsp:useBean id="m" scope="application" class="MD5.MD5"/>
<%
String user_name=new String(request.getParameter("name").getBytes("ISO8859_1"), "GBK");
String user_key=new String(request.getParameter("key").getBytes("ISO8859_1"), "GBK");
String key_confirm=new String(request.getParameter("key_confirm").getBytes("ISO8859_1"), "GBK");
String user_enterprise_name=new String(request.getParameter("enterprise").getBytes("ISO8859_1"), "GBK");
String s="0";
int count=0;
user_key=m.getMD5ofStr(user_key);
try{
Connection con=j.getConnection();
Statement statement=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String checksql="select user_name from user_info where user_name='"+user_name+"'";
ResultSet r=statement.executeQuery(checksql);
while(r.next())
{
count++;
}
if(count!=0)
{
out.print("对不起,该用户名以存在!请重新注册!");
}
else
{
String upsql="insert into user_info (user_name,user_key,user_enterprise_name,s) values ('"+user_name+"','"+user_key+"','"+user_enterprise_name+"','"+s+"')";
statement.executeUpdate(upsql);
}
j.releaseConnection(con);
out.print("注册成功!");
}
catch(SQLException ee){out.print("对不起!和以注册企业名称重复");}
%>