Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Home page should be displayed on successfull login after session expired

 
Akhil Kashyap
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John.
 
amrish sharma
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Akhil Kashyap
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic