本帖最后由 oicp110 于 2010-04-01 09:26:22 编辑

解决方案 »

  1.   

    javaBean里面最好只写get,set方法。验证的方法可以放到其他的地方。将业务和逻辑分离,这样比较规范。
    一般的思路是,登录后,把用户名和密码传给后台,例如servlet之类的。然后由后台处理判断,并指派地址。
      

  2.   

                        request.setAttribute("password", rs.getString("password"));
                        request.setAttribute("username", rs.getString("username"));
                        session.setAttribute("password", rs.getString("password"));
                        session.setAttribute("username", rs.getString("password"));
    确定是这样?
      

  3.   

    可以这样.......
    1.修改checklogin()方法 传递参数(userId,password)返回 对象
    2.在test2.jsp中else内 再setProperty 每个属性值  scope="page" 改为scope="session" 
    3.在你要显示的Welcome.jsp 直接从userBean中再挨个getProperty获取出来就ok了当然这个不好 但是能显示 
    最好是写个servlet 使用 jstl标签 这样格式更清楚吧 ........