Search code examples
jsfmyfacesviewexpiredexception

JSF - set STATE_SAVING_METHOD per-page


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.


Solution

  • 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.