| Author |
Home page should be displayed on successfull login after session expired
|
Akhil Kashyap
Greenhorn
Joined: Feb 12, 2010
Posts: 17
|
|
Hi
I am working on an application with following environment:
JSP, EJB 2.0,JBoss3.2,Windows Server 2003
I am facing a problem that if user was on a jsp say abc.jsp and session expired, now if user clicks on any link on that jsp he will be asked to enter login credentials again and after successfull authentication will be redirected to the same page (abc.jsp in this case).
I want home.jsp to be displayed to user after successfull login( and not abc.jsp) no matter what.
P.S. User logs in through login.jsp and after JAAS auhentication redirected to home.jsp
Regards
Akhil.
|
 |
John Storta Jr.
Greenhorn
Joined: Jul 26, 2009
Posts: 29
|
|
I am not sure I fully understand your issue, but here is my input.
I would setup a ServletFilter rather than do everything in JSP.
As an example, if you have pages in a private area, you define a ServletFilter that runs when the URL contains the string 'PRIVATE'.(/myapp/PRIVATE/destinationpage.jsp)
In that filter, you check to see if the session has expired. If it has, you send the user to login.jsp. If the session is still valid, then you pass them through to the requested page.
login.jsp then always sends users to home.jsp if the login is successful.
|
 |
Akhil Kashyap
Greenhorn
Joined: Feb 12, 2010
Posts: 17
|
|
|
Thanks John.
|
 |
amrish sharma
Greenhorn
Joined: Sep 24, 2009
Posts: 20
|
|
|
|
 |
Akhil Kashyap
Greenhorn
Joined: Feb 12, 2010
Posts: 17
|
|
Hi John,
Filter approach is not working as filter does not get invoked when one is using j_security_check along with JBoss.
Any other work around from any one?
Akhil.
|
 |
 |
|
|
subject: Home page should be displayed on successfull login after session expired
|
|
|