我现在的系统登陆之后,取用户的姓名的时候,session的值在页面取不到,不知道到底是什么意思, 反正就是值取不到,后台Action执行没有问题,我测试了,大家有没有碰到啊 ,帮帮忙解决哈   我的后台:          session.setAttribute("userInfo", userInfoVO);
          return mapping.findForward("success");  前台:
 
    <logic:empty name="userInfo">
  <a href="${ctx}/" target="_top">--- 请登录!---</a>
  </logic:empty>
<logic:notEmpty name="userInfo">${userInfo.username}</logic:notEmpty>
这样写应该不是错的吧

解决方案 »

  1.   

    <logic:NotPresent name="userInfo"> 
      <a href="${ctx}/" target="_top">--- 请登录!--- </a> 
      </logic:NotPresent > 
    <logic:notEmpty name="userInfo">${userInfo.username} </logic:notEmpty>
      

  2.   

    可以正常登陆,但是不能取sessoin中的值吗?lz先试试看不用标签,直接<%%>去去看~这种错误一般都是一些细节的地方没注意,排查一下代码吧,以前有同学也遇到过类似情况~
      

  3.   

    不用标签也是一样的,这是为什么呢?
    现在的错误是:Cannot create a session after the response has been committed
    第一次碰到。
      

  4.   

    你确定写进去了吗?你试试看能不能打印出来。还有你能登陆也不代表你的session存在啊
      

  5.   

    so it's should be done.