在public boolean fRoot()中
  String sSql="select * from deng where root='"+root+"'";的root没有赋值我想应该是
public boolean fRoot(String root)
  String sSql=="select * from deng where root='"+root+"'";然后在调用时用:
 if(login.fRoot(request.getparmeter("root"))){
 out.println("用户名不存在!");
 return;
 }

解决方案 »

  1.   

    我在dbBean里附了值得,int root=0;
      

  2.   

    将conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=deng","sa","kfa");
      
    改为
    conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433/deng","sa","kfa");试一下
      

  3.   

    要使用<jsp:setProperty name="login" property="*" />
    必须在class check里有以下语句:public String root;
    public String pw;然后定义:
    public void setRoot(String strRoot)
    {
        root = strRoot;
    }
    public void setPw(String strPW)
    {
        pw = strPW;
    }
    public String getRoot()
    {
        return root;
    }
    public String getPW()
    {
        return pw;
    }
      

  4.   

    以上是固定格式,要使用<jsp:setProperty name="login" property="*" />
    必须定义属性。以上的4个方法就是属性。