日期:2014-05-18  浏览次数:20661 次

为什么我写好javabean,写jsp页面后在调试,老是出现这样的错误?
org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP

Generated   servlet   error:
C:\Tomcat   5.0\work\Catalina\localhost\_\org\apache\jsp\a\student\userInfo_jsp.java:6:   package   grad.util.user   does   not   exist
import   grad.util.user.*;;
^


An   error   occurred   at   line:   10   in   the   jsp   file:   /a/student/userInfo.jsp
Generated   servlet   error:
C:\Tomcat   5.0\work\Catalina\localhost\_\org\apache\jsp\a\student\userInfo_jsp.java:60:   cannot   find   symbol
symbol     :   class   op_user
location:   class   org.apache.jsp.a.student.userInfo_jsp
  op_user   ope=new   op_user();//鏋勯?犵敤鎴锋搷浣滃璞?
  ^


An   error   occurred   at   line:   10   in   the   jsp   file:   /a/student/userInfo.jsp
Generated   servlet   error:
C:\Tomcat   5.0\work\Catalina\localhost\_\org\apache\jsp\a\student\userInfo_jsp.java:60:   cannot   find   symbol
symbol     :   class   op_user
location:   class   org.apache.jsp.a.student.userInfo_jsp
  op_user   ope=new   op_user();//鏋勯?犵敤鎴锋搷浣滃璞?
                                  ^


An   error   occurred   at   line:   10   in   the   jsp   file:   /a/student/userInfo.jsp
Generated   servlet   error:
C:\Tomcat   5.0\work\Catalina\localhost\_\org\apache\jsp\a\student\userInfo_jsp.java:61:   cannot   find   symbol
symbol     :   class   user
location:   class   org.apache.jsp.a.student.userInfo_jsp
  user   us=ope.getUserByUserCode((String)session.getAttribute( "usercode "), "1 ");
  ^
4   errors


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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



------解决方案--------------------
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\a\student\userInfo_jsp.java:6: package grad.util.user does not exist
import grad.util.user.*;;


你看这个路径是正常的吗?
C:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\a\student\userInfo_jsp

明显提示你引这个包
import grad.