我找到原因了是因为使用了<jsp:useBean>才出错的,因为其他jsp能正常工作
jsp页面代码是
<%@ page contentType="text/html"%>
<jsp:useBean id="test" scope="session" class="testBean"/>
<%=test.getUserid()%>
<%=test.getPassword()%>类testBean代码为
public class testBean implements java.io.Serializable{
  private String userid = "init";
  private String password = "init";  public String getUserid() {
    return userid;
  }
  public void setUserid(String userid) {
    this.userid = userid;
  }
  public String getPassword() {
    return password;
  }
  public void setPassword(String password) {
    this.password = password;
  }
}
请问什么原因

解决方案 »

  1.   

    把$JAVA_HOME/lib/tools.jar复制到 Tomcat下的 common/lib
      

  2.   

    奇怪jsp标签自动解析了< % @ page contentType="text/html"% >
    < jsp:useBean id="test" scope="session" class="testBean" />
    < %=test.getUserid()% >
    < %=test.getPassword()% >
      

  3.   

    把$JAVA_HOME/lib/tools.jar复制到 Tomcat下的 common/lib
    支持bean要加包
      

  4.   

    < % @ page contentType="text/html"% >
    < jsp:useBean id="test" scope="session" class="testBean" />
    < %=test.getUserid()% >
    < %=test.getPassword()% >不能有空格 <%
      

  5.   

    bean必须要打包吗?没听说有这个规则啊
      

  6.   

    现在tomcat 中是必须的加包也是好的习惯