File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Closing popup windows that have timed out

 
Raghu Marpalli
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am generating a popup window from my application. The application control is such that if the session has timed out, the user is directed to a login page.

If the session has timed out and a popup window is open, clicking on a link takes the user to the login page. I dont want the same to occur as I dont want the user logging in from a popup window etc.

I would rather close out these windows. How can this be accomplished?

Thanks much in advance
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can think of a couple of ways you might accomplish this:

1.Automatically refresh the page every minute or so, and have it check for the existence of a session each time it refreshes. If none exists, close the window.

2.The same as number 1, except that you make an AJAX call to the server checking for a session instead of refreshing the page.

3.I've been hearing about something called COMET, which is like AJAX, except that it will allow Javascript code to respond to an event initiated by the server. I don't know much about it, but I was thinking you could implement an Application event listener on the server that fires when the HttpSession is about to time out, and then have the server throw a COMET event that javascript code in the document receives and then closes the window.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic