请问Unable to load class for JSP 怎么解决? 急用
<html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title>...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Session对象示例-第一网页</title>
</head>
<body>
<p align="left"><font size="5">对象示例-第一网页</font>
</p>
<hr>
<%
String sessionName=(String)session.getAttributr("sessionName");
if((sessionName!="")&&(sessionName!=null))
{
out.println("你已经登陆了你的名字为"+sessionName);
}
else
{out.println("你是第一次接受本咨询");
}
%>
<form action="SessionObject2.jsp" method="post" enctype="application/x-www-form-urlencoded" name="list">
<table width="28%" border="0">
<tr>
<td width="27%"align="right">
<p align="center">姓名:
</td>
<td width="73%"><input type="text"name="name"size="12"></td>
</tr>
<tr>
<td width="27%"align="right">
<input type="submit"value="用户信息提交"name="B1">
</td>
<td width="73%"><input type="reset"value="用户信息重写"name="B2"></td>
</tr>
</table>
</form>
</body>
</html>
出现
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.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:623)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.SessionObject1_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:299)
java.net.URLClassLoader$1.run(URLClassLoader.java:288)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:287)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:621)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 展开
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Session对象示例-第一网页</title>
</head>
<body>
<p align="left"><font size="5">对象示例-第一网页</font>
</p>
<hr>
<%
String sessionName=(String)session.getAttributr("sessionName");
if((sessionName!="")&&(sessionName!=null))
{
out.println("你已经登陆了你的名字为"+sessionName);
}
else
{out.println("你是第一次接受本咨询");
}
%>
<form action="SessionObject2.jsp" method="post" enctype="application/x-www-form-urlencoded" name="list">
<table width="28%" border="0">
<tr>
<td width="27%"align="right">
<p align="center">姓名:
</td>
<td width="73%"><input type="text"name="name"size="12"></td>
</tr>
<tr>
<td width="27%"align="right">
<input type="submit"value="用户信息提交"name="B1">
</td>
<td width="73%"><input type="reset"value="用户信息重写"name="B2"></td>
</tr>
</table>
</form>
</body>
</html>
出现
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.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:623)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.SessionObject1_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:299)
java.net.URLClassLoader$1.run(URLClassLoader.java:288)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:287)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:621)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 展开
2个回答
展开全部
类没找到。
WEB工程的编译路径没有设定正确。
右键->属性->java build path 指定到WEB工程的/WEB-INF/classes下。
WEB工程的编译路径没有设定正确。
右键->属性->java build path 指定到WEB工程的/WEB-INF/classes下。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我用你给的代码试验了,提示却是:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 11 in the jsp file: /fhjm.jsp
The method getAttributr(String) is undefined for the type HttpSession
……
An error occurred at line: 17 in the jsp file: /fhjm.jsp
Syntax error on tokens, delete these tokens
……
你先把这两行中的语法错误修改一下,再试。
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 11 in the jsp file: /fhjm.jsp
The method getAttributr(String) is undefined for the type HttpSession
……
An error occurred at line: 17 in the jsp file: /fhjm.jsp
Syntax error on tokens, delete these tokens
……
你先把这两行中的语法错误修改一下,再试。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询