This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to redirect to login page

 
suresh pulapally
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we are developing a web application on bea.our requirement is after session timeout any request should be forward to login page(i set session timeout in web.xml),how to know that session is timeout and how to redirect it login page.

thanx

[Bear edit: added meaningful title]
[ May 15, 2005: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On a sucessfull login, bind an object to the user's session.
With each hit to any of your other pages (a ServletFilter is perfect for this) check the session for the existence of this object.
If it's there, you know the user is currently logged in.
If it's null, you know they're not. Redirect them to the login page.
[ May 15, 2005: Message edited by: Ben Souther ]
 
suresh pulapally
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx,
i will try this.
 
Neerajplus Kumarplus
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example.

http://neeraj.name/2005/05/03/javascript-to-perform-a-client-side-redirect-upon-session-expiration/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic