How to redirect to an error page when database is down

We have build an struts/jsp-application with JDeveloper 10g and ADF. If the connection to the database fails, we get a plain page with header "500 Internal Server Error" and the exception and a stack trace. Of course we want to catch this exception and redirect the user to an error page with all of the standard design elements of our site and with a textual description of the error of our one choice.
Our attempts to solve this includes adding error-page tags with error-code and exception-type:
<error-page>
<exception-type>javax.servlet.jsp.JspTagException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>oracle.jbo.JboException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>oracle.jbo.DMLException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>error.jsp</location>
</error-page>
Are there other ways to do this, or are there things we have forgotten to do, that has to be done for this solution to work.
We have also tried try and catch in a variety of the lifecycle methods in the DataAction subclass for the page, but none of these are ever called. It seems the error happens before the first lifecyle method starts. We can't figure out where to catch this exception.
In other cases the web.xml mechanism seems to work.

Try the Global Exception Mechanism within Struts...

Similar Messages

  • How to redirect to a different page when a browser's Back button is clicked

    In my application a user logs-in and searches on the form provided. Now
    If a I click on browser's Back Button I see a message saying Page Has Expired, now at this point if I click on the browsers refresh button it shows me the page again.I want if browser back button is clicked and then Refresh button is clicked I don't want to show the same page rather redirect to a different page and invalidate the session. Is there a way clicking on browser back button I redirect to a different page.I have the following code on top of each jsp pages:
    response.setHeader("Cache-Control","no-cache"); //forces caches to obtain a new copy of the page from the origin server
    response.setHeader("Cache-Control","no-store"); //directs caches not to store the page under any circumstance
    response.setDateHeader("Expires", 0); //causes the proxy cache to see the page as "stale"
    response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibilityAny help is appreciated. Thanks

    There's no way to know when the back button is clicked, so I don't see how you can do anything about it. Since that message comes from a page which was created by a POST form submission, you can put some unique value in a hidden field that let's the server side record and if it gets it again (from the reload) then it can ignore the form data and redirect.

  • Is there a way to limit the number of allowed sessions (or limit based on load) to iWS, and redirect to an error page when this number is reached?

    We have a setup with two iWS servers infront of an iAS cluster and want to give a 'nice' error message upfront, instead of running the backend servers to the limit affecting the overall user experience.

    Typically a server has a settable parameter to limit concurrent connections. Check the server's documentation.

  • Custom error Page when Run time Occurs in SharePoint

    Hi Guys In my SharePoint application in case if any Run time error occurs in my code, It should not come Server error \ ..instead it needs to redirect to Custom error Page But its not working Can you plz help out? I made changes in web.Config file but its
    not working..Can you guys plz help me out how to redirect to custom error Page if any run time error occurs in Sharepoint??
       <customErrors mode="RemoteOnly" defaultRedirect="~/GeneralError.htm" redirectMode="ResponseRedirect"></customErrors>
     [[ Web.config file in Virtual Directory C:/inetpub/wwwroot/vd/port/web.config
    Is there any changes in addition to this web.config file??
    Reddy

    Hi Reddy,
    Here you go. pls follow the tutorials
    http://www.fixthisbug.com/post/creating-a-custom-error-page-for-sharepoint-2010-web-application
    http://blog.incworx.com/blog/sharepoint-tips-and-tricks/implementing-sharepoint-2010-custom-error-pages-v3
    http://www.spdeveloper.co.in/articles/pages/custom-error-pages-for-sharepoint2010-sites.aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to redirect user from login page to "Set Challenge question" page

    How to redirect user from login page to "Set Challenge question" page (NOT custom page) after 3 un successful password attempts?
    Meaning when user types wrong password 3 times they will be redirected to set Challenge question page. If user answers the challenge question then password reset page should be appeared other wise (after remaining 3 un successeful challenge question answers) account should be locked out.
    thanks for your help.

    hi sandeep
    Thanks for your answer. Let me ellaborate more on the requirement here.
    - Password Policy and Lost Password management are set up in the identity system
    - Configure login tries allowed= 5. Verify accout is lock out after 5 unsucessful login.
    This is what need to achieve.
    1) If a user attempts to login 3(not 5) times using an incorrect login credential he/she should be redirected to set challenge question (security question) page.
    2) Then if the user attempts (remaining) 2 times incorrect challenge answer then his/her account should be locked out.
    3) If he/she answers the challenge answer correctly then he/she should be redirected to password reset page.
    Is this possible?

  • How can we define custom error page in protal application

    How can we define custom error page in protal application, like we define "jsp Error page " in JSPs

    Hi,
    Check these:
    Customization of Portal Runtime Errors and portal standard error codes
    http://help.sap.com/saphelp_nw04/helpdata/en/9a/e74d426332bd30e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ec/1273b2c413b2449e554eb7b910bce7/frameset.htm
    Regards,
    Praveen Gudapati

  • How to avoid printing a blank page when there is 'no data' in the report.

    how to avoid printing a blank page when there is 'no data' in the report.

    try like this
    if@section:IND=1
    this template
    end ifsectionbreak
    if@section:IND=2
    this template
    end if

  • How do I fix -50 error message when syncing phoneon Windows 7?

    How do I fix -50 error message when syncing phone on Windows 7?

    Quit Mail. Back up all data.
    Triple-click the line of text below to select it, then copy to the Clipboard:
    /Library/Mail/Bundles
    In the Finder, select Go ▹ Go to Folder from the menu bar. Paste into the box that opens, then press return.
    A folder may open. If it does, move the following item in that folder to the Trash:
    UnsubMailPluginMailAppOSX.mailbundle
    You may be prompted for your password when you do this.
    Launch Mail.

  • TS1539 How do we deal with Error 50 when downloading a movie rental then stopped with error 50 and when I try to resume the downld, it doesn't do it?

    How do we deal with Error 50 when downloading a movie rental then stopped with error 50 and when I try to resume the downld, it doesn't do it?

    Yeah this "fix" is bunk. The movie is downloading just fine, but the extra features is the one giving me this error code. It is NOT my firewall. If it was, then both files wouldn't download. Plus, I already have the firewall "issue" tacked down and fixed. Have had it fixed for months now. No, this is due to the "new" itunes version 11 software. The only conclusion to fix this issue is UPgrading from 11 back to 10.7 which is what I am going to do. This is completely ridiculous! Come on, Apple, get itunes working once and for all, and fire the people responsible for itunes 11, just like you did to the guy who was responsible for apple maps. Thankfully Google came back to the rescue with google maps app.

  • TS3694 how do you solve a error 1015 when restoring a iphone from recovery mode?

    how do you solve a error 1015 when restoring a iphone from recovery mode?

    This error is generally exhibited when someone tries to downgrade iOS. See this support document http://support.apple.com/kb/TS3694
    This is the part you are looking for.
    Errors related to downgrading iOS
    The required resource cannot be found: This alert message occurs when your device has a newer version of iOS than what is available in iTunes. When troubleshooting a device that presents this alert message, go to Settings > General > About and check the version of iOS on the device. If it is newer than the latest released iOS version, the device may have a prerelease developer version of iOS installed. Installing an older version of iOS over a newer version is not supported. 
    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.

  • How do you deal with error message when downloading movie on iPad?  It was 75% complete.

    How do you deal with error message when downloading movie on iPad2.  Movie was 75% complete. 

    I was using wifi.  It shows as a purchase on iTunes but it does not show up on iTunes for download.  I keep getting the download error with our a number attached on the iPad.  Very frustrating.   Apple has been of no help at all. 

  • Why do I get an error page when I select Toolkit for CreateJS? I am using CS6 Flash Pro.

    Why do I get an error page when I select Toolkit for CreateJS? I am using CS6 Flash Pro.

    hello Mac.INXS, please [[Clear the cache - Delete temporary Internet files to fix common website issues|clear the cache]] & [[Delete cookies to remove the information websites have stored on your computer|cookies from mozilla.org]] and then try logging into AMO again.

  • To retain the title bar as in the page when we scroll down the report.

    Hi,
    I want to retain the Report name in the page when i scroll down to access the report columns. i don't want the report name to disappear when we scroll down the report.
    Is that possible??
    if yes...how??
    Thanks.

    Hi,
    Try to configure Freeze Panes in OBIEE11g it will resovle your issue (obiee11g version obiee11.1.1.6.0 and above)
    http://oraclebisolutions.blogspot.com/2012/12/freeze-column-headers-in-obiee-11g111160.html
    http://ebs2obiee.wordpress.com/2012/05/08/freeze-panes-in-obiee11g-working-solution/
    Thanks
    Deva

  • Error message when Database details are not configured properly

    Hi,
    I am using JDeveloper 11.1.1.1.4 and ADF-BC in my project.
    I use Weblogic Data Source connection to connect to Database.
    I have a requirement that when data base details are not configured properly in Weblogic Data Source or when Database is down,I need to display an error message either when I access application task flows or in login page itself when application starts.
    Can I achieve this???Please advice.
    Regards,
    Praveen

    Praveen,
    Check out Steve's example
    https://blogs.oracle.com/smuenchadf/resource/examples#129
    -Arun

  • Redirect to a custom error page when Forms Server shuts down

    Hi,
    I want the forms application to redirect to a custom error page whenever Forms Server goes down. (like network issues, unscheduled shutdown...) Whenever this happens, the user gets a pop up with FRM messages and user has to acknowledge the pop up. Since the application is used in the shop floor, there will not be any user always in front of the screen and will be a very big issue as there are at least 70-80 PC's on the floor which will be attended fewer times(only when there is issue with the machine) other wise the application displays important events of the machine,etc.,
    I am trying to develop a simple HTML error page(may be with applet) which will keep querying the forms server and once the forms server is up and running, the error page will revert back to the application which the user was working earlier to shutdown. Other option is the redirect to main menu of the application (this may be a PSP or a JSP or a Oracle Forms Menu ).
    Is there any event in forms to capture the loss of connection to forms server ??
    BTW, I am using Oracle Application Server 10g Forms and Reports on Windows 2000 Server...
    Any ideas...
    Thanks in advance
    Purush

    I don't think it will be easily possible in Forms for a couple of reasons.
    1. In Forms you do not have query rights, and as soon as you want to edit data, you have to log in. In Forms you log in once, and this sets your rights for the whole session. You will have to do some programming in Forms to achieve what you want. E.g. as soon as you hit the Save button you are asked for a username and password.
    2. A refresh cannot be done in Forms. Remember that Forms is a Java applet. The URL in the browser is just pointing to the startup page only. If you refresh your screen, you are taken back to the login screen of Forms again.
    Well, there will probably be ways around these problems. I'm thinking in the line of calling every form in a separate URL instead of starting a Forms application where one form is called from another form. The default 'query only' form can be called from a startup html page. This page can be refreshed. As soon as the user wants to update data, he clicks on a link or button and is taken to a login form.
    If the refresh is unsuccessful you are taken to a custom error page, like in your ASP application.
    A problem with an automatich refresh may be hanging sessions. Forms server does not always kill sessions.
    And also, how would you avoid a refresh if a user is currently using the form?

Maybe you are looking for