• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

will code put in stop() work ..?

 
sarim raza
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a bidding room applet
if one user leaves, i would like to be able to delete his name from list.
if user leaves the current page stop() method of applet is called, so can i call some method from the stop method
public void stop()
{
textfield1.append("stopping");
//POST to JSP page that deletes user from database
}

will this work ??
and will other users of room be able to see the "stopping" message ?
thanks
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, your applet can talk to the app server, via the web server it's been downloaded from, so you should be able to change the state in some database for the user that is leaving. The applets in the browsers' of the other clients will need to periodically check the database and refresh their display based on the latest data, but your idea sounds workable. Note that if the user crashes out of the browser or otherwise force-quits, your applet might not get the stop() method call, and your database may think the user is still logged in, when in fact they no longer are, so you will have to come up with ways of dealing with that potential issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic