UseBean&&页面调用Servlet路径

开发工具:NetBean
<web.config>下的Servlet配置
    ......
   <servlet>
        <servlet-name>getAccount</servlet-name>
        <servlet-class>myServlet.getAccount</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>getAccount</servlet-name>
        <url-pattern>/servlet/getAccount</url-pattern>
    </servlet-mapping>
   ........
 
调用Servlet的页面Action
      <form action="servlet/getAccount" method="post">
      </form>
 
 
今天在JSP中使用UseBean动作标签时,系统报“The value for the useBean class attribute XXX is invalid” 这个错误,后来才发现在class中必须要有一个Public的默认构造函数,汗! 学习了~~~~~
------------------------------------------------------------------------------------------
使用Tomcat 常见 "The value for the useBean class attribute is invalid" 错误。该错误是指 JSP 中给定的 useBean 标签的 class 属性的值无效
 
可见错误可能的原因包括:
1. 在编译 JSP 时(不是运行时),指定的 Bean 类没找到
2. Bean 虽然找到了,但是它不是 public 的,或者找到的 class 文件是 interface 或抽象类
3. Bean 类中没有 public 的默认构建函数

你可能感兴趣的:(servlet,职场,useBean,休闲)