• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session invalidate

 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

i configure session timeout in my web.xml....

when the session time is complete,it is going to login page!!!.

i can not understand why it is?(by default going to loginpage(index.jsp)).....


but i want to show another jsp page after timeout...

please can anyone explain me..

thanks & regards,
seetharaman
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In the sessionDestroyed method of SessionListener, forward to the signup page(whatever you want) using the Servlet Context's request dispatcher.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ashok,
Thanks for your earnest reply...

well,..but my sessionDestroyed() method is in java class..

here how can i get request object so that,i can forward to my jsp page..

please explain me..

thanks & regards,
seetharaman
 
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can write a filter, which forwards to login page, if theres no session.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

can anyone tell how to use RequestDispatched or anyother mechanism to forward to my jsp page...
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sudhir",
Please check your private messages.
-Ben
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


here how can i get request object so that,i can forward to my jsp page..



You can't - there will never be a request when a session times out and is invalidated by the servlet container because initial processing of a request resets the timer for the matching session.

Bill
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks William,

i want to show my jsp page..after session timeout in DD.for that wat can i do?..

i am waiting for your earnest reply..

thanks & regards,
seetharaman
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think about this:

How will you identify a request as belonging to a recent user whose session timed out versus a request from a brand new user?

There is no way you can do this using ONLY the session mechanism.

I suggest you could use c ookies just like commercial sites do. Amazon recognizes me because my browser has (one or more) long-lived c ookie specific to the Amazon URL.

See the JavaDocs for java.servlet.http.C ookie for an introduction on how to create your own c ookies. Search for RFC 2965 for the complete rules on c ookies.

Bill
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks william ;)
 
reply
    Bookmark Topic Watch Topic
  • New Topic