When the users attempt login to my application after supplying credentials & pressing the commandButton(whose action attribute redirects user to a relevant page after verification), my app is instantiating a @RequestScoped bean when the action attribute’s method is executed. Now after the redirection is done, after successful login, this bean is again needed on the redirected page. But this bean was destroyed, so it is required to be re-created.
Is this just normal ? I expect the bean to be there for the complete request as redirection was just a part of the request.
Anyways if this is normal for a request bean what is the alternative for me to survive this complete request but no longer after that.
Yes that is normal, the life of request scoped bean is from request – response,
if you do redirect it would be