HttpSession session = request.getSession(true);
userInfoBean userinfos = (userInfoBean )session.getAttribute("userinfo");

解决方案 »

  1.   

    是不是需要在JSP页面中使用setSttribute来定义这个对象??
      

  2.   

    session.setAttribute("userinfo",userinfo)试试
      

  3.   

    不用。scope="session"This value means that, in addition to being bound to a local 
    variable, the bean will be stored in the HttpSession object 
    associated with the current request, where it can be retrieved 
    with getValue(in Servlet 2.1) or getAttribute(in Servlet 2.2)
      

  4.   

    我用的是Jbuild6.4,老是不行,返回的总是null,可以帮我看看吗,可以的话,可以使用QQ,我的QQ:93964156