为什么在访问localhost:8080\main.jsp时出现错误“useBean类属性action.TestBean的值无效”

为什么在访问localhost:8080\main.jsp时出现错误“useBean类属性action.TestBean的值无效”,jsp,Jsp,我知道以前有人问过这个问题,但这些帖子提供的解决方案对我没有任何帮助。 我有一个TestBean类,它位于一个名为action的包中。它确实有一个公共构造函数。 WEB-INF/classes/action已编译TestBean类。 我有一个main.jsp文件,它位于tomcat根文件夹中webapps的根文件夹中。我在class path变量中设置了WEB-INF/classes/action的类路径 这里是我所指内容的链接。 这是密码 TestBean.java /* File: Tes

我知道以前有人问过这个问题,但这些帖子提供的解决方案对我没有任何帮助。 我有一个TestBean类,它位于一个名为action的包中。它确实有一个公共构造函数。 WEB-INF/classes/action已编译TestBean类。 我有一个main.jsp文件,它位于tomcat根文件夹中webapps的根文件夹中。我在class path变量中设置了WEB-INF/classes/action的类路径

这里是我所指内容的链接。

这是密码 TestBean.java

/* File: TestBean.java */
package action;

public class TestBean {
   private String message = "No message specified";
   public TestBean()
   {

   }    
   public String getMessage() {
      return(message);
   }
   public void setMessage(String message) {
      this.message = message;
   }
}
main.jsp

<html>
<head>
<title>Using JavaBeans in JSP</title>
</head>
<body>
<center>
<h2>Using JavaBeans in JSP</h2>

<jsp:useBean id='test' >
    <jsp:attribute name="class" trim="true">action.TestBean</jsp:attribute>
</jsp:useBean>

<jsp:setProperty name="test" 
                    property="message" 
                    value="Hello JSP..." />

<p>Got message....</p>

<jsp:getProperty name="test" property="message" />

</center>
</body>
</html>
这是日志文件

127.0.0.1 - - [06/Apr/2014:07:21:30 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /tomcat.css HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /tomcat.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-middle.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-button.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-upper.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /asf-logo.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-nav.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:33 +1000] "GET /manager/html HTTP/1.1" 401 2550
127.0.0.1 - tomcat [06/Apr/2014:07:21:42 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:07:21:42 +1000] "GET /manager/images/tomcat.gif HTTP/1.1" 304 -
127.0.0.1 - tomcat [06/Apr/2014:07:21:42 +1000] "GET /manager/images/asf-logo.gif HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:22:41 +1000] "GET /hello.jsp HTTP/1.1" 200 138
127.0.0.1 - - [06/Apr/2014:07:29:00 +1000] "GET /hello.jsp HTTP/1.1" 200 198
127.0.0.1 - - [06/Apr/2014:19:29:25 +1000] "GET /hello.jsp HTTP/1.1" 200 198
127.0.0.1 - - [06/Apr/2014:23:00:50 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:23:00:50 +1000] "GET /tomcat.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:50 +1000] "GET /tomcat.css HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-middle.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-button.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-upper.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /asf-logo.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-nav.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:54 +1000] "GET /manager/html HTTP/1.1" 401 2550
127.0.0.1 - tomcat [06/Apr/2014:23:00:56 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:23:00:56 +1000] "GET /manager/images/asf-logo.gif HTTP/1.1" 304 -
127.0.0.1 - tomcat [06/Apr/2014:23:00:56 +1000] "GET /manager/images/tomcat.gif HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:01:18 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:03:23 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:03:45 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:07:11 +1000] "GET /main.jsp HTTP/1.1" 500 2967
127.0.0.1 - - [06/Apr/2014:23:09:08 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:10:05 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:10:58 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:12:18 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:12:32 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:12:45 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - tomcat [06/Apr/2014:23:12:47 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:23:12:49 +1000] "GET /manager/html/list?org.apache.catalina.filters.CSRF_NONCE=90251ED57E2071F7C450C04B1D8FDEE7 HTTP/1.1" 200 21021
127.0.0.1 - - [06/Apr/2014:23:13:10 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:23:13:13 +1000] "GET /host-manager/html HTTP/1.1" 401 2112
127.0.0.1 - tomcat [06/Apr/2014:23:13:17 +1000] "GET /host-manager/html HTTP/1.1" 403 2869
127.0.0.1 - tomcat [06/Apr/2014:23:13:27 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/html-manager-howto.html?org.apache.catalina.filters.CSRF_NONCE=A6FA451BAA505B551747159EE14D3227 HTTP/1.1" 200 48922
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/images/tomcat.gif HTTP/1.1" 200 2066
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/images/asf-logo.gif HTTP/1.1" 200 7279
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/images/void.gif HTTP/1.1" 200 43
127.0.0.1 - tomcat [06/Apr/2014:23:13:37 +1000] "GET /manager/html/list?org.apache.catalina.filters.CSRF_NONCE=A6FA451BAA505B551747159EE14D3227 HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:23:13:44 +1000] "POST /manager/html/stop?path=/&org.apache.catalina.filters.CSRF_NONCE=18214A73AC6421E7B3900D8790E50B4B HTTP/1.1" 200 20534
127.0.0.1 - tomcat [06/Apr/2014:23:13:45 +1000] "POST /manager/html/start?path=/&org.apache.catalina.filters.CSRF_NONCE=33395CE44598F949ECB8FAE64A85D07A HTTP/1.1" 200 21063
127.0.0.1 - - [06/Apr/2014:23:17:00 +1000] "GET /index.jsp HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:23:17:08 +1000] "GET /hello.jsp HTTP/1.1" 200 199
127.0.0.1 - - [06/Apr/2014:23:17:16 +1000] "GET /main.jso HTTP/1.1" 404 967
127.0.0.1 - - [06/Apr/2014:23:17:19 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:19:40 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:20:03 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:23:00 +1000] "GET /main.jsp HTTP/1.1" 500 2928
127.0.0.1 - - [06/Apr/2014:23:26:35 +1000] "GET /main.jsp HTTP/1.1" 500 2949
这里是我提到的另一个链接

在tomcat日志中,我发现根本原因是 JasperException:useBean类属性的值无效

但是上面的链接似乎也没有帮助
我想知道日志文件末尾最后4行左右的含义?GET/main.jsp HTTP/1.1500 2949的确切含义是什么?这里是表明这种非意义的linnk,我使用来自thr控制台的javac命令编写了这个类。我不明白你用错误的方式编译它是什么意思,例如不考虑包也会导致这个错误。请详细说明我的错误:。那么我应该如何编译我的类?他为什么删除他的评论?
127.0.0.1 - - [06/Apr/2014:07:21:30 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /tomcat.css HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /tomcat.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-middle.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-button.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-upper.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /asf-logo.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:32 +1000] "GET /bg-nav.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:21:33 +1000] "GET /manager/html HTTP/1.1" 401 2550
127.0.0.1 - tomcat [06/Apr/2014:07:21:42 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:07:21:42 +1000] "GET /manager/images/tomcat.gif HTTP/1.1" 304 -
127.0.0.1 - tomcat [06/Apr/2014:07:21:42 +1000] "GET /manager/images/asf-logo.gif HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:07:22:41 +1000] "GET /hello.jsp HTTP/1.1" 200 138
127.0.0.1 - - [06/Apr/2014:07:29:00 +1000] "GET /hello.jsp HTTP/1.1" 200 198
127.0.0.1 - - [06/Apr/2014:19:29:25 +1000] "GET /hello.jsp HTTP/1.1" 200 198
127.0.0.1 - - [06/Apr/2014:23:00:50 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:23:00:50 +1000] "GET /tomcat.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:50 +1000] "GET /tomcat.css HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-middle.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-button.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-upper.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /asf-logo.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:51 +1000] "GET /bg-nav.png HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:00:54 +1000] "GET /manager/html HTTP/1.1" 401 2550
127.0.0.1 - tomcat [06/Apr/2014:23:00:56 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:23:00:56 +1000] "GET /manager/images/asf-logo.gif HTTP/1.1" 304 -
127.0.0.1 - tomcat [06/Apr/2014:23:00:56 +1000] "GET /manager/images/tomcat.gif HTTP/1.1" 304 -
127.0.0.1 - - [06/Apr/2014:23:01:18 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:03:23 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:03:45 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:07:11 +1000] "GET /main.jsp HTTP/1.1" 500 2967
127.0.0.1 - - [06/Apr/2014:23:09:08 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:10:05 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:10:58 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:12:18 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:12:32 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:12:45 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - tomcat [06/Apr/2014:23:12:47 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:23:12:49 +1000] "GET /manager/html/list?org.apache.catalina.filters.CSRF_NONCE=90251ED57E2071F7C450C04B1D8FDEE7 HTTP/1.1" 200 21021
127.0.0.1 - - [06/Apr/2014:23:13:10 +1000] "GET / HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:23:13:13 +1000] "GET /host-manager/html HTTP/1.1" 401 2112
127.0.0.1 - tomcat [06/Apr/2014:23:13:17 +1000] "GET /host-manager/html HTTP/1.1" 403 2869
127.0.0.1 - tomcat [06/Apr/2014:23:13:27 +1000] "GET /manager/html HTTP/1.1" 200 21021
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/html-manager-howto.html?org.apache.catalina.filters.CSRF_NONCE=A6FA451BAA505B551747159EE14D3227 HTTP/1.1" 200 48922
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/images/tomcat.gif HTTP/1.1" 200 2066
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/images/asf-logo.gif HTTP/1.1" 200 7279
127.0.0.1 - - [06/Apr/2014:23:13:32 +1000] "GET /docs/images/void.gif HTTP/1.1" 200 43
127.0.0.1 - tomcat [06/Apr/2014:23:13:37 +1000] "GET /manager/html/list?org.apache.catalina.filters.CSRF_NONCE=A6FA451BAA505B551747159EE14D3227 HTTP/1.1" 200 21021
127.0.0.1 - tomcat [06/Apr/2014:23:13:44 +1000] "POST /manager/html/stop?path=/&org.apache.catalina.filters.CSRF_NONCE=18214A73AC6421E7B3900D8790E50B4B HTTP/1.1" 200 20534
127.0.0.1 - tomcat [06/Apr/2014:23:13:45 +1000] "POST /manager/html/start?path=/&org.apache.catalina.filters.CSRF_NONCE=33395CE44598F949ECB8FAE64A85D07A HTTP/1.1" 200 21063
127.0.0.1 - - [06/Apr/2014:23:17:00 +1000] "GET /index.jsp HTTP/1.1" 200 11418
127.0.0.1 - - [06/Apr/2014:23:17:08 +1000] "GET /hello.jsp HTTP/1.1" 200 199
127.0.0.1 - - [06/Apr/2014:23:17:16 +1000] "GET /main.jso HTTP/1.1" 404 967
127.0.0.1 - - [06/Apr/2014:23:17:19 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:19:40 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:20:03 +1000] "GET /main.jsp HTTP/1.1" 500 2949
127.0.0.1 - - [06/Apr/2014:23:23:00 +1000] "GET /main.jsp HTTP/1.1" 500 2928
127.0.0.1 - - [06/Apr/2014:23:26:35 +1000] "GET /main.jsp HTTP/1.1" 500 2949