Session Bean being lost?

前端 未结 2 529
忘了有多久
忘了有多久 2021-01-07 05:42

The first \"nonpostback\" request to viewBean, someValue property in sessionBean is null. Now, in a postback request, I am setting a user input to someValue. The problem is

相关标签:
2条回答
  • 2021-01-07 06:01

    This is a known issue:

    SessionScoped bean inside a ViewScoped bean is resolved as different bean depending on the expression used

    I just changed the state saving method in my web.xml:

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    
    0 讨论(0)
  • 2021-01-07 06:25

    I use GAE (Google App Engine) and need to set javax.faces.STATE_SAVING_METHOD to client. This problem can have workaround. After the action, just call refreshSession() with new value force the session object persist

    protected void refreshSession(){
        saveSession(CeaConst.SESSION_ATTR_NAME_LAST_REFRESH_TIME, new java.util.Date());
    }
    
    0 讨论(0)
提交回复
热议问题