Solved

Explorer shows custom error when using <error-page> for error 500 in tomcat

Posted on 2009-05-12
1
904 Views
Last Modified: 2013-12-02
Hello!
I setup my tomcat to handle exceptions and errors, and to redirect to custom pages.
However, explorer shows a default error when presented with a 500 error. I know I can disable this on the explorer, but I'm looking for a way to do this on the server side.

And if there's a way to make spring handle  it, better yet

   
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	version="2.4">
 
	<display-name>sample-01</display-name>
 
	
 
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
 
	
	<!-- Http Flex Session attribute and binding listener support -->
	<listener>
		<listener-class>flex.messaging.HttpFlexSession</listener-class>
	</listener>
 
	
	
	<!-- spring security filter-->
	<filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
	<filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
 
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/applicationContext*.xml</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
 
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
	
	<error-page>
	    <exception-type>org.springframework.security.ui.preauth.PreAuthenticatedCredentialsNotFoundException</exception-type>
	    <location>/authenticationException.jsp</location>
	  </error-page>
	
	 <error-page>
        <error-code>500</error-code>
        <location>/error.jsp</location>
    </error-page>
    
    <error-page>
        <error-code>403</error-code>
        <location>/error403.jsp</location>
    </error-page>
    
    
</web-app>

Open in new window

0
Comment
Question by:dhunter_12
1 Comment
 

Accepted Solution

by:
dhunter_12 earned 0 total points
ID: 24367884
I found that increasing the HTML page size to more than 256 bytes makes explorer think that the page is prettier than the default, forcing it to use my custom page, instead of the explorer default.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
session migration servlets 2 36
couple of eclipse 5 36
specific questions about shipping a coat 4 42
by zero exception 10 40
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question