A4j:keepalive stores your backing bean in the view object.
Thus, the bean is saved with the view in the session.
After the view is restored, the bean is set back in the request scope.
In a memory usage point of view, it's better to use "request scope" bean than "session scope" bean.
The keepalive tag is more flexible way to use "request scope" bean.
But there is two issues with keepalive tag :
- It does not work with "redirect".
- The saved bean is not available during the first phase (restore view)
I mainly use request beans.
You mantioned two isues, how can those isues represent a real problem?
What did you mean with redirect? I use keepAlive only for storing the bean value during ajax requests on the sam page, I dont nead the bean anymore if I redirect the aplication on some other page.
I also didn't undestand the second issue, In which cases would I nead the bean in the restore view Phase.
I'm quite new to JSF and I dont jet realy understand the whole JSF lifecycle magic.
about redirect. No, you can freely use JSF navigation and the bean will be stored.
But the navigation case should not be redirect one. Because in this case view created from scratch (as for first time page visit) and objects stored in view lost.