This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes UnavailableException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "UnavailableException" Watch "UnavailableException" New topic
Author

UnavailableException

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I have a question about the UnavailableException(String msg, int seconds)
Say, we have
protected void doGet(HttpServletResponse res, HttpServletREquest req)throws IOException, ServletException{
if(someBoolean){
throw new UnavailableExeption("Unavailable from doGet", 10);
}
// some presentation here;
}
The first time we get a someBoolean==true, and the UnavailableExcption was thrown for 10 seconds. Then within 3 seconds, a second request comes in while someBoolean is still ==true; this time, will the UnavailableException be overridden to another 10 seconds?
Moreover, if, within 3 seconds, another request comes with someBoolean==false, will the presentation be shown, or it will be referred to the designated error page?
Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
By my reading of the API, subsequent requests will get a SERVICE_UNAVAILABLE (503) message until the time is up.
Bill

------------------
author of:
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you Bill.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnavailableException
 
Similar Threads
Servlet init()
Threads and DB Access
Some more stuff for WCD Guys
more doubts
session