---
title: "错误页面跳转解决办法"
author: "microjava"
date: "2010-06-09T15:50:29Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-06-09T17:39:12Z"
id: 688083
url: "https://microjava.iteye.com/blog/688083"
---

错误页面跳转解决办法

在web.xml中配置错误页面跳转如下： 
  <error-page> 
    <exception-type>java.lang.Exception</exception-type> 
    <location>/error.html</location> 
  </error-page> 

  <!-- 页面不存在时跳转-->
  <error-page>
    <error-code>500</error-code>
    <location>/error.html</location>
  </error-page>
  
  <error-page>
    <error-code>404</error-code>
    <location>/error.html</location>
  </error-page>
 
制造空指针异常，启动tomcat服务器发现并不能跳转到error.jsp,而是跳转到IE的错误提示页面 

注意： 

1.确保error.jsp的大小>1024字节。