1

We can increase the number of view session in JSF through specify a larger number of numberOfViewsInSession and numberOfLogicalViews in web.xml. However, we have faced a difficult problem under multiple browser tabs situation. When user open multiple tabs and actively use one of the tab by selecting link with Get request or open dialog with dialog framework, the view of other inactive tabs will be expired when he /she select a dropdown that will trigger a ajax Post request.

May I know is there any best practice to handle JSF view under multiple browser tab situation?

mehere
  • 1,487
  • 5
  • 28
  • 50
raymond.mh.ng
  • 343
  • 2
  • 3
  • 21

1 Answers1

-1

You can increase the number of views in session via com.sun.faces.numberOfLogicalViews and com.sun.faces.numberOfViewsInSession for Mojarra and via org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION and org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION for MyFaces.

A more detailed explanation can be found here.

Community
  • 1
  • 1
Syren Baran
  • 444
  • 2
  • 8
  • We have already include the numberOfViewsInSession to increase the physical view and numberOfLogicalViews to increase the logical view. However, according to my previous scenario, no matter how large the number we put in the numberOfLogicalViews, user may still experience ViewExpiredException if he / she active involve GET request in one of the browser tab. – raymond.mh.ng Apr 21 '15 at 03:23
  • You hadnt mentioned `numberOfLogicalViews` in your question. And the scenario you describe should only happen if your number of browser tabs exceeds the number of logical views. – Syren Baran Apr 21 '15 at 07:13
  • I am sorry about the numberOfLogicalViews parameter. I have just added it back. Thanks for your reminder. Regarding the number of tab, according to our test, a new view is created if user involve any GET request or openDialog function. – raymond.mh.ng Apr 21 '15 at 07:44