aspose file tools*
The moose likes JSP and the fly likes HTTP Status 503 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "HTTP Status 503" Watch "HTTP Status 503" New topic
Author

HTTP Status 503

gavin liu
Greenhorn

Joined: Sep 15, 2008
Posts: 4
I include an iframe in jsp for posting request to the server when the top page be opened. 95% times it work, but I also sometime got HTTP Status 503 in the iframe.

I can't figure out why it happened and how to solve it, or maybe I could catch it in this page with java or javascript so I can disable this iframe.

anyone meet this kind of trouble before, please give me an answer.

Thank you very much.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

"gavin nobody", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

Well, would not the first step be to find out what's causing the 503 error? That's the code for "service unavailable" which is usually delivered when the server is overloaded. If such is the case, do you really feel that disabling the iframe is the best reaction?
gavin liu
Greenhorn

Joined: Sep 15, 2008
Posts: 4
Bear Bibeault,

Thank you for your prompt reply.

HTTP Error 503 - Service unavailable

It doesn't happened very often. that is perfect If we could find a way to solve it totally, if we can't, It is not a bad idea that disable the iframe temporarily when this exception throw out.

Do you know how to catch this exception?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

"gavin nobody", My PM request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Be aware that accounts with invalid display names are disabled.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

You can declare an error handler for this error code in the deployment descriptor.
gavin liu
Greenhorn

Joined: Sep 15, 2008
Posts: 4
Could you please tell me some detail about how to declare an error handler in the deployment descriptor.

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

You would use the <error-page> element in the deployment descriptor. The Servlet Specification is the best place to look for details.
gavin liu
Greenhorn

Joined: Sep 15, 2008
Posts: 4
Add <error-page> element in web.xml will influence all this type of Exception for this web application, but, what I want to do is only for this page.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

Since the error is occurring in a request within an iframe, the parent page has no way of capturing the exception.

It will need to be dealt with in the child request. And, since the server is refusing requests, there's no way to catch it in your code, which isn't being run.

Why are you using an iframe in the first place?
 
 
subject: HTTP Status 503