How can I set the view timeout?

后端 未结 1 1495
遇见更好的自我
遇见更好的自我 2020-12-16 19:46

In our JSF2 project on JBoss 7.1.1, we define a session timeout in the web.xml and it works just fine.

However, sometimes we\'re gettin

相关标签:
1条回答
  • 2020-12-16 19:53

    Another cause of ViewExpiredException is that too many logical views are been created in the session. The default limit is JSF implementation specific and every synchronous GET request on a particular view basically creates a new view. So, for example, when you use Mojarra (which has a default limit of 15) and start a browser session and open the same view in 16 different tabs and then submit a form in the 1st one, then you may get this exception as well. The limit is configureable with a JSF implementation specific context parameter, which is com.sun.faces.numberOfLogicalViews for Mojarra and org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION in MyFaces (defaults to 20).

    This is however a very rare real world problem. If your webapp is really designed to be used this way (e.g. a social/community site which invites to being opened in multiple tabs, such as discussion forum or Q&A), then you might consider using client side state saving instead.

    See also:

    • javax.faces.application.ViewExpiredException: View could not be restored
    • com.sun.faces.numberOfViewsInSession vs com.sun.faces.numberOfLogicalViews
    0 讨论(0)
提交回复
热议问题