From: Francisco Passos [mailto:[EMAIL PROTECTED] Sent: Friday, July 13, 2007 1:07 PM To: MyFaces Discussion Subject: Login filter + redirect to previous
Good afternoon. I'm using a filter to check for a session bean with user login details and redirecting to a login page to enforce the user to login once more if the session has expired or if the user is not logged in. I'd like to know which alternatives I have to redirect the user after the login to the page he intended to go in the first place. A simple approach is to put the originally requested page in the session. You can then wire up that value to the login bean via the MBCF, and your login bean can call ExternalContext.dispatch() to forward the user to the appropriate page upon completion. Note that you should clear the value from the session when you're finished with it. Another approach is to have a session-scoped bean hold the value instead of storing it directly in the session. You would still wire up this bean to your login bean. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kito D. Mann - Author, JavaServer Faces in Action <http://www.virtua.com/> http://www.virtua.com - JSF/Java EE consulting, training, and mentoring <http://www.jsfcentral.com/> http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info * Sign up for the JSF Central newsletter! <http://oi.vresp.com/?fid=ac048d0e17> http://oi.vresp.com/?fid=ac048d0e17 *

