to jfy3d(剑事):
可以说的详细点嘛?怎么实现

解决方案 »

  1.   

    应该是把username,password写入到session中吧?
    那几个对应的名字都是什么?
      

  2.   

    if(type!=null)
    {
    sql="select * from usertable where mobile='"+user+"' and mobilepwd='"+password+"'";
    }else{
    sql="select * from usertable where UserName='"+user+"' and Password='"+password+"'";
    } ResultGather rs = new ResultGather(sql);
    List list = rs.selectRS();
    if(!list.isEmpty())
    {
    request.getSession().setAttribute("userid",((Map)list.get(0)).get("UserName"));
    request.getSession().setAttribute("mobile",((Map)list.get(0)).get("mobile"));
    request.getSession().setAttribute("mobilecan",((Map)list.get(0)).get("mobilecan"));
    request.getSession().setAttribute("mobilepwd",((Map)list.get(0)).get("mobilepwd"));
    flag = true;
    }
      

  3.   

    session.setAttribute()应该可以了
      

  4.   

    to jfy3d(剑事):
    你这样写,就不会弹出那个框了嘛?
    好像你这样写入到session中跟这个http的验证没什么直接的关系吧?
      

  5.   

    to tom2005(快乐着) :
    就是你反问有些站点,他会弹出个窗口,让你输入用户名和密码的嘛?
    怎么拼成一个url,就直接可以访问,不用输了?
      

  6.   

    还不是很明白怎么拼成一个url,就直接可以访问,不用输了?
      

  7.   

    to  qiaomai(乔麦) :
    这样写我也试过,好像不行的
      

  8.   

    to  tom2005(快乐着) :
    就是类似这种写法的http://username:[email protected]
    用户名和密码不用输了
      

  9.   

    用session 或者 cookie
     然后跳转到  http://username:[email protected]
      

  10.   

    我说的是跳出的http验证,好像跟session没什么关系吧?
    难道就没有人知道嘛?
    急阿,谁帮帮我阿