当然可以放在 WEB-INF/classes 下

解决方案 »

  1.   

    Examples:
    login.jsp:
    <%@ page contentType="text/html;charset=BIG5"%>
    <html>
    <title>Beans 的使用</title>
    <body>
    <center>
    Beans 的使用
    </center>
    <hr>
    <center>
    <h2>
    <jsp:useBean id="login" scope="session" class="practice.logindata"/>
    <jsp:setProperty name="login" property="loginName" param="tbxName"/>
    <jsp:setProperty name="login" property="password"/>輸入姓名:<jsp:getProperty name="login" property="loginName"/><br>
    輸入的密碼:<%=login.getPassword()%>
    </h2>
    </center>
    </body>
    </html>login.htm
    <html>
    <title>Beans 的使用</title>
    <body>
    <center>
    Beans 的使用
    </center>
    <hr><form action="login.jsp"method=post name=form1>
    <p>請輸入姓名:<input type=text name=tbxName></p>
    <p>密碼:<input type=password name=password></p>
    <input type="submit" value="提交" name=submit1>
    <input type="reset" value="清除" name=reset1>
    </form>
    </body>
    </html>logindata.java:
    public class logindata {
    private String Name="";
    private String Pwd="";  public logindata() {
      }  public void setLoginName(String name) {
         this.Name=name;
      }
      public void setPassword(String Pwd) {
        this.Pwd=Pwd;
      }  public String getLoginName() {
        return this.Name;
      }
      public String getPassword() {
        return this.Pwd;
      }
    }
      

  2.   

    我不知道你所说的解释是什么意思。Tomcat 不能把java编译成class
    Resin 就可以了。在resin下你写个bean然后浏览(jsp)他自动就能编译,但是你tomcat就不能做到。
      

  3.   

    比较同意aleccheung(浪子狂人) 
    应该说tomcat支持(使用)javabean.
    编译javabean到.class是编译器的问题了。