Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9308271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:35:29+00:00 2026-06-19T00:35:29+00:00

There is an option in java web applications to handle exceptions by defining error-page

  • 0

There is an option in java web applications to handle exceptions by defining error-page in web.xml:

<error-page>
<error-code>500</error-code>
<location>/error500.jsp</location>
</error-page>

I am wondering if there could potentially be a problem with defining a JSP error page (as opposed to an HTML error page).
Because JSPs run at server side. Can there be a scenario where the server is “half-dead”, throws an exception, tries to redirect to the error page, but can’t render it because of being “half-dead”?

By “half-dead” I mean that the server is in a state where some things still work, but other things don’t work. Specifically I mean that whatever controls the redirecting to the error-page defined in web.xml still works, but the actual rendering of the JSP doesn’t work for some reason (something throws an exception).

I didn’t actually see a problem like this, but I wonder if it’s possible. Because then potentially an HTML error page would work (because it has no server side logic), while the JSP error page wouldn’t work.

And if this is the case, then how can I “fall back” to the HTML error page when the JSP error page fails?
I still want to use the JSP error page for displaying the error details that came back on the response, but if it’s not possible then I want to show the HTML page.

I hope that makes sense….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:35:30+00:00Added an answer on June 19, 2026 at 12:35 am

    I found a solution:

    1. Define the error 500 to redirect to a servlet (instead of a page)
    2. Define also a 404 error page – make it a simple HTML page.
    3. In the servlet, redirect to the JSP error 500 page.
    4. All the logic in the servlet is surrounded with a try-catch block. The catch block does response.sendError(HttpServletResponse.SC_NOT_FOUND); which will redirect to the error 404 page defined in web.xml.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an option/parameter to deploy an application client with java-web-start enabled with the
Is there any option to clear the console screen in Java as clrscr() in
I am used to develop web applications in Java (Struts, Spring, JSP...). But now
I am trying to build an error reporting service for my web page. The
I'm building a Flex web application where there is an option to export data
I have a Java web-app using standard web.xml and servlets. At the moment, I'm
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
Is there any option to tell gs to convert strokes to fills? Something similar
Is there an option to show the full command when using an alias? Example:
Is there an option for the curl command to show only a percentage output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.