回 帖 发 新 帖 刷新版面

主题:恳求bean高手援助我的一个简单问题!

我在class中建了个bean:SimpleBean.class,在ROOT/web建了个testbean.jsp:
<%@page contentType="text/html;charset=gb2312" language="java"%>
<jsp:useBean id="test"scope="application" class="SimpleBean"/>
<html>
<head>
<title>Simple Bean</title>
</head>
<body>
running
<hr>
<center>
<%=test.getMessage()%>
</center>
</body>
</html>
然后在浏览器中输入 http://210.41.121.166:8080/web/testbean.jsp
可问题是怎么出现了以下错误:
type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /web/testbean.jsp
Generated servlet error:
D:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\web\testbean_jsp.java:44: cannot resolve symbol
symbol  : class SimpleBean
location: class org.apache.jsp.web.testbean_jsp
      SimpleBean test = null;
      ^


An error occurred at line: 2 in the jsp file: /web/testbean.jsp
Generated servlet error:
D:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\web\testbean_jsp.java:46: cannot resolve symbol
symbol  : class SimpleBean
location: class org.apache.jsp.web.testbean_jsp
        test = (SimpleBean) _jspx_page_context.getAttribute("test", PageContext.APPLICATION_SCOPE);
                ^


An error occurred at line: 2 in the jsp file: /web/testbean.jsp
Generated servlet error:
D:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\web\testbean_jsp.java:48: cannot resolve symbol
symbol  : class SimpleBean
location: class org.apache.jsp.web.testbean_jsp
          test = new SimpleBean();
                     ^
3 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:412)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    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.28 logs.

我实在没办法解决,希望各位高人帮帮小弟,小弟万分感激呀。
时刻在线等待!
谢谢!

回复列表 (共1个回复)

沙发

SimpleBean不在类路径中,找不到此类.

我来回复

您尚未登录,请登录后再回复。点此登录或注册