tags:

views:

334

answers:

1

Hello,

I have a small window holding an IRC client that opens up when the user logs into a jsp page. I'm trying to figure out a way for an SQL update statement to be called once the pop up window has been closed.

Anyone have any ideas on how I could go about doing this?

Thanks

~ Kyle G

+1  A: 

One possible solution is to have the pop-up window execute a "heartbeat" request to the server via AJAX to indicate that it's still open. On the server side a table listing active windows is maintained with the "last-update" timestamp. Have a thread (servlet started when the application launches) on the server periodically checking every few seconds and execute the update on those windows which have not provided a heartbeat within X seconds.

Michael Glenn