Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JSP and the fly likes display message when browser is inactive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "display message when browser is inactive" Watch "display message when browser is inactive" New topic

display message when browser is inactive


Joined: Dec 14, 2001
Posts: 1
i want to display some message in browser .if the user does not perform any action after login with in one hour.i need help
the code may be in jsp or javascript
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

your user name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing the
guidelines at
thanks for your cooperation.
- satya

Take a Minute, Donate an Hour, Change a Life
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
Hello Sirisha,
You can use HttpSession for user Inactivity.

Sarath Mohan
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Originally posted by binu kavumkal:

You can use HttpSession for user Inactivity.

-- but this won't display a message in the inactive browser -- HTTP is stateless -- your server can't randomly contact browsers who made requests to it previously. I don't think what you want is possible.
The best you can do is to invalidate the session after a certain period (check session.setMaxInactiveInterval() ) and if the person tries to contact the app after their session has been inactivated, redirect them to a login screen.
- Jessica Bradley
HP Bluestone

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
I agree. Here's the link:
subject: display message when browser is inactive
It's not a secret anymore!