当前位置: 代码迷 >> Java Web开发 >> 求救 求救 JPS 开发 连接编译出现 异常 org.apache.jasper.JasperException: Unable to load class for JSP
  详细解决方案

求救 求救 JPS 开发 连接编译出现 异常 org.apache.jasper.JasperException: Unable to load class for JSP

热度:1072   发布时间:2016-04-17 00:22:40.0
求救 求救 JPS 开发 连接编译出现 错误 org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:599)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

java.lang.ClassNotFoundException: org.apache.jsp.user_005fadd_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:597)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)



原代码 

<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ import="java.sql.*"%>
<!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>
<body>
<%
String strSql="";
String database_username="sa";
String database_password="";
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=ch3";
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
Connection dbConn = DriverManager.getConnection(url,database_username,database_password);
Statement stmt=dbConn.createStatement();
ResultSet rs=null;
String s_UserName = requset.getParameter("UserName");
strSql = "select * from users where UserName like
'"+s_UserName+"'";
rs = stmt.executeQuery(strSql);
if(rs.next())
{
out.println("<h1 align=center>用户名<font
color=red>"+s_UserName+"</font>已经存在!</h1>");
out.println("<div align=center><input type=button name=btn
value=返回 onClick='window.history.go(-1)'></div>");
}
else
{
String s_UserPassword = 
request.getParameter("UserPassword");
String s_NickName = request.getParameter("NickName");
String s_Sex = request.getParameter("Sex");
String S_Email = request.getParameter("Email");
strSql = "insert into users (UserName,UserPassword,NickName,Sex,Email)
values('"+s_UserName+"','"+s_UserPassword+"','"+s_NickName+"',
'"+s_Sex+"','"+s_Email+"')";
stmt.executeUpdate(strSql);
out.println("<h1 align=center>用户注册成功,您注册信息如下</h1>");
out.println("<p align=center>用户名:<font color=blue>"+s_UserName+"</font></p>");
out.println("<p align=center>密码:<font color=blue>"+s_UserPassword+"</font></p>");
  相关解决方案