Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to redirect user to the page/link where he was before session expire ?  RSS feed

 
Abhijit Salunkhe
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pros,

Let me explain my problem with the help of following steps.

1. User logs in to the system to see the default main page.
2. He browses through the application, at some point he reaches pageX( There is a link on pageX say linkY).
3. He goes away for some time. His session on server expires in the meantime
4. When he comes back and clicks on linkY of pageX, system redirects him to the login page.
5. Once logged in what he sees is default main page and not desired pageY of linkY

Is there any way I can do this without losing session status of the user when he was on pageY ?

Thanks in advance,
Abhijit Salunkhe
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you implement declarative security for the web app this should happen automatically. The user will be redirected to the page he wanted to see on his next login attempt (when the session expires). Have a look at the auth constrain, web resource collection, security role and related elements in web.xml
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!