Reputation:
I would like to display a custom error message when users try to access my website, and it is not reachable. Instead of - Internet Explorer cannot open the Internet site, I want to show, "We are currently down for maintenance. Please be patient. We'll be back!".
Please suggest how do I achieve this?
Upvotes: 1
Views: 100
Reputation: 280171
You are confusing things. The error message
Internet Explorer cannot open the Internet site
given by Internet Explorer just means it can't connect to your web server. It's not something your application can control.
What you can control is what is returned in the case of any error that occurs in your application or any status your application is in. For example, for a 503 Service Unavailable you can render a special JSP.
How you do this is up to you. You have to first figure out that the service is unavailable (or some other cause), whatever that means to your application, and then produce an appropriate http response with an appropriate status code. The standard status codes can be found here.
Upvotes: 2