This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Server Time out? how to catch it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Server Time out? how to catch it?" Watch "Server Time out? how to catch it?" New topic
Author

Server Time out? how to catch it?

eric sato
Ranch Hand

Joined: Oct 01, 2002
Posts: 37
hi all,
Currently i'm using SilverStream as an Application Server. But i have a servlet it sometime take processing more than server specified time out(eg. 3000 seconds). So usually user will see in browser with error server timeout. (it is standard way). But i need a "listener" or a program within that servlet, that able to catch the server time out when it occured. How do i do that? Hope some of you may help me out!!!
Only thing that i have in my mind is using IOException in service method. But i can't figure out how to start it.
Thanks in advance.
eric s.


If you can't change the direction the the wind, change your sail.
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
3000 seconds to procceed a servlet? do you expect
a user to wait for the result 50 minutes?


Asher Tarnopolski
SCJP,SCWCD
eric sato
Ranch Hand

Joined: Oct 01, 2002
Posts: 37
hi Asher
3000 seconds just a example only. The actual time is 10 minutes and i implemented only in in-house system. So any idea to catch it?
eric s.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I think you better redesign your application - the browser - webserver architecture just does not work well when the response is delayed that long.
You should think in terms of starting a separate worker Thread to do the long processing, with some sort of mechanism so the user can be updated periodically as to how things are going.
Seems to me we have had a number of discussions of this sort of thing on this forum in the last few months.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server Time out? how to catch it?