2

I would like to set a particular page (one that does not require a user to sign in to use) to have a STATE_SAVING_METHOD of client rather than server while the rest of the pages use server. Is there a way to set it on a per-page basis?

I would like to do this to get around the dreaded ViewExpiredException.

OddProblems
  • 201
  • 2
  • 10

2 Answers2

2

There is no way. This is however been requested as new feature. See also JSF spec issue 1056.

To solve the particular ViewExpiredException issue, you need to look for alternative ways. You can just ask a new question here about specifically the issue you have. There are always ways to go around it.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
1

The state saving method is set once in web.xml and is there for the whole app. If you don't want that particular view to expire you could do an ajax poll that "pings" the page in a specific interval of time and thus avoiding view expired exception. Kinda workaround but this is the way with stateful frameworks.

Adrian Mitev
  • 4,722
  • 3
  • 31
  • 53
  • BalusC was nice enough to provide the implementation here: http://stackoverflow.com/questions/8793064/jsf-keep-a-session-alive-for-an-indefinite-amount-of-time/8794320#8794320 – OddProblems Jan 09 '12 at 22:45