useBean 类属性 ****** 的值无效

发布于 2024-12-03 09:36:31 字数 2524 浏览 0 评论 0原文

我使用 Tomcat 6 并有位于服务器上的 jsp 文件和 java 文件 ] 这些是我在服务器上上传的所有文件

WEBINF/classes/layar/Testing.java
WEBINF/index.jsp
WEB-INF/lib/alt-rt.jar
WEB-INF/lib/charsets.jar
WEB-INF/lib/deploy.jar
WEB-INF/lib/dt.jar
WEB-INF/lib/javaws.jar
WEB-INF/lib/jce.jar
WEB-INF/lib/jconsole.jar
WEB-INF/lib/jspcontrols-rt.jar
WEB-INF/lib/jsse.jar
WEB-INF/lib/management-agent.jar
WEB-INF/lib/plugin.jar
WEB-INF/lib/resources.jar
WEB-INF/lib/rt.jar
WEB-INF/lib/sa-jdi.jar
WEB-INF/lib/tools.jar

Testing.java 文件

     package layar;

     import java.io.*;

      public class easyTesting 
      {
        public  void startCode()  
        {
         File f = new File("layertestnew.php");
          if(!f.exists())
          {
              f.createNewFile();
          }
          else 
          {
            f.delete();
          }
        }

        }

这是index.jsp 文件

        <!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=ISO-8859-1">
      <title>Layer Easy testing</title>
      </head>
      <jsp:useBean id="link" class = "layar.Testing" />
      <body>
      <form action="poi.jsp" method="post">
      <INPUT type="button" value="Create script file" onClick = <%
  link.startCode(); %> "window.location.reload()"><br>
      <br>
      Select POIs type
      <div align="left"><br>
      <input type="radio" name="poi" value="1"  checked > dynamic<br>
      <input type="radio" name="poi" value="2">static<br>
       <input type="radio" name="poi" value="3"> both<br>

       <INPUT type="submit"  value="save"  ><br>

      </div>
      </form>
      </body>
      </html>

当我打开 http://79.125.23.143:8080/lezv/index.jsp

我收到下一个错误

    org.apache.jasper.JasperException: /index.jsp(9,0) The value for the useBean class   

     attribute layar.Testing is invalid.


    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)

I use Tomcat 6 and have jsp file and java file which is located on the server
]
These are all files which I upload on the server

WEBINF/classes/layar/Testing.java
WEBINF/index.jsp
WEB-INF/lib/alt-rt.jar
WEB-INF/lib/charsets.jar
WEB-INF/lib/deploy.jar
WEB-INF/lib/dt.jar
WEB-INF/lib/javaws.jar
WEB-INF/lib/jce.jar
WEB-INF/lib/jconsole.jar
WEB-INF/lib/jspcontrols-rt.jar
WEB-INF/lib/jsse.jar
WEB-INF/lib/management-agent.jar
WEB-INF/lib/plugin.jar
WEB-INF/lib/resources.jar
WEB-INF/lib/rt.jar
WEB-INF/lib/sa-jdi.jar
WEB-INF/lib/tools.jar

Testing.java file

     package layar;

     import java.io.*;

      public class easyTesting 
      {
        public  void startCode()  
        {
         File f = new File("layertestnew.php");
          if(!f.exists())
          {
              f.createNewFile();
          }
          else 
          {
            f.delete();
          }
        }

        }

this is index.jsp file

        <!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=ISO-8859-1">
      <title>Layer Easy testing</title>
      </head>
      <jsp:useBean id="link" class = "layar.Testing" />
      <body>
      <form action="poi.jsp" method="post">
      <INPUT type="button" value="Create script file" onClick = <%
  link.startCode(); %> "window.location.reload()"><br>
      <br>
      Select POIs type
      <div align="left"><br>
      <input type="radio" name="poi" value="1"  checked > dynamic<br>
      <input type="radio" name="poi" value="2">static<br>
       <input type="radio" name="poi" value="3"> both<br>

       <INPUT type="submit"  value="save"  ><br>

      </div>
      </form>
      </body>
      </html>

And when I open http://79.125.23.143:8080/lezv/index.jsp

I get the next error

    org.apache.jasper.JasperException: /index.jsp(9,0) The value for the useBean class   

     attribute layar.Testing is invalid.


    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文