Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how long a connection btw servlet and applet last?

 
may Lee
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused with the ini() and destroy() for servlet. It is said that they are for servlet containter, so normally we don't need to btoher to use it.

If I have applet in a html file on webserver, this applet calls servlet on Tomcat by URL connection, then the servlet do a lot of data search(need long time) then return some data to the applet. For this case, the connection btw the applet and servlet will stay there until users close their web browser? is it right?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually no, there's a separate HTTP timeout -- the URL connection will eventually time out after a few minutes if the servlet takes too long to process. The length of that timeout is something you can adjust in your application server configuration.

And "destroy()" is only called when the servlet container shuts down.

Kyle
 
may Lee
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you show ne where to configure the HTTP timeout? Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic