• Post Reply Bookmark Topic Watch Topic
  • New Topic

What happen when applet browser is closed?  RSS feed

SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing an applet that do nothing but will keep track total time the window is opened. I do a http get request in applet's destroy()/stop() method to check in with a servlet about its closing time. When applet is reload(), this process is completed and servlet can get the reload time. However, when the browser is closed, the get request is not transmitted because the URL.openStream() cannot succeed. Thus, i cannot open a BufferedStreamReader to read the reponse from the server (this step is needed to complete a TCP/IP cycle). How can i make the last request successful by modifying my applet?
Here is my code snippet.
URL url = new URL(url_to_servlet);
BufferedReader bf = new BufferedReader(
new InputStreamReader(
//This readLine() is needed to complete a request.
String temp = bf.readLine();
}catch(Exception e){}
Can anyone help?
[ June 27, 2002: Message edited by: SoonAnn Lim ]
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!