I am getting 'ViewExpiredException' on click of back button, in Chrome browser ONLY (IE and Firefox - no issue). This happens ONLY when the previous view has some ajax updates.
- Load home.xhtml (let's say, javax.faces.viewState-sequence - 1)
- Do some Ajax updates on home.xhtml (let's say, javax.faces.viewState-sequence - 2)
- PRG and go to home.xhtml again (let's say, javax.faces.viewState-sequence - 3)
- Press Chrome Back button.
- Page loads. (Now view is having javax.faces.viewState-sequence - 2 - ISSUE is instead of having new sequence id - 4 it is getting the previous sequence id - 2. That means page may be loading from Cache. As I do remove the previous views from server, view with sequence id - 2 is not present).
- Any click (post back/ajax) shows ViewExpiredException.
NOTE: If Step 2 above is skipped, there is no issue, as in the following
- Load home.xhtml (let's say, javax.faces.viewState-sequence - 1)
- PRG and go to home.xhtml again (let's say, javax.faces.viewState-sequence - 3)
- Press Chrome Back button
- Page loads. (It is having javax.faces.viewState-sequence - 4 - NO ISSUE. That means page IS NOT loading from Cache)
- Any click (post back/ajax) - no issue.
Please note that I am on MyFaces 2.1.8 and I am also using NoCacheFilter as suggested by BalusC. That is why IE and Firefox has no issues, but issue is only with Chrome, and that too ONLY when the previous view has ajax updates.
Any help or pointers to fix the problem or your first thoughts, are very much appreciated.
Please let me know if any information that I might have missed and you may want to know.
Update: 6/27/14
In the above case, please advice if I could manually create and build the view when the restored view returns null during postback, using custom ViewHandler. I have checked the answer to question, Can you POST to JSF2 page with an expired session?. But it is not working in my setup, and it shows the blank white page. Any idea. Is it because I am using MyFaces 2.1.8 and it has different implementation of state manager ?
Thanks very much in advance. Best Regards, Kumar.