Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes how long a connection btw servlet and applet last? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how long a connection btw servlet and applet last?" Watch "how long a connection btw servlet and applet last?" New topic
Author

how long a connection btw servlet and applet last?

may Lee
Ranch Hand

Joined: Nov 20, 2003
Posts: 68
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

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
may Lee
Ranch Hand

Joined: Nov 20, 2003
Posts: 68
Could you show ne where to configure the HTTP timeout? Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how long a connection btw servlet and applet last?