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 5948337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:05:35+00:00 2026-05-22T17:05:35+00:00

I have a such problem: i’ve set the dafault error page in web.xml on

  • 0

I have a such problem: i’ve set the dafault error page in web.xml on java.lang.Exception type, thus it has to be shown on all exceptions in servlets and jsp. But when I want to test this page(I turn off the connection) it doesn’t apper in the browser. in tested servlet I use database, so if there is no connection it will throw an exception. In servlet I catch this exception and throw new ServletException(). also in catch block at first I log the message and then throw an exception. So why my tomcat doesn’t show this error page? Instead of this it show blank page and in server output I can see these error messages

edit

 <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/errorPages/InternalError.jsp</location>
    </error-page>

i save error pages in /errorPages
and the page that have to be shown called InternalError.jsp

This page has to be shown after moving to the jsp page which is using El to show data from database which in that jsp fall throw object that is in session

  • 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-05-22T17:05:36+00:00Added an answer on May 22, 2026 at 5:05 pm

    You will get a blank page in such situation when the response is already committed by the servlet or the JSP causing the exception. In other words, when the HTTP response headers are already been sent to the webbrowser. This is a point of no return.

    To prevent this, you need to ensure that you start writing to the response only when all business code has finished its job (better, just don’t do that in the servlet, but just forward to a JSP) and also that your JSPs does not contain any single line of business code (often represented by scriptlets <% %>).

    So if you do for example this in a servlet

    response.getWriter().write("blah");
    throw new ServletException("epic fail");
    

    or when the exception is been thrown “halfway” a JSP

    <p>Some HTML</p>
    <% throw new ServletException("epic fail"); %>
    <p>Some more HTML</p>
    

    then the risk is big that you get a blank page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have such a basic problem in Delphi,I can't solve it. My Code: Note:DataR
I do not have problem as such but I am quite new to Ruby.
I have some problem whith such mysql_query INSERT INTO table VALUES ('', CURDATE()-1) why
I have such a link in JSP page with encoding big5 http://hello/world?name=婀ㄉ And when
I have such an AppleScript: tell application Firefox activate set the bounds of the
I have such problem: I have 2 custom components, which have their own nesting
I'm trying to work with sockets and I have such problem In code example:
i have seen a few days ago such problem there is given two array
I have such text: <Neednt@email.com> If you do so, please include this problem report.
I have little problem with my iphone application. I have such classes and interfaces:

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.