---
title: "Java - 配置404/500错误界面指向"
author: "topsale"
date: "2011-04-12T09:55:02Z"
tags: []
categories: ["编程语言"]
slug: "java-404-500"
draft: false
lastmod: "2011-04-12T10:00:42Z"
id: 998500
url: "https://topsale.iteye.com/blog/998500"
---

在web.xml加多一个配置：
代码如下：

```xml

<!-- 注意这里必须是*.jsp -->
<error-page>
	<error-code>404</error-code>
	<location>/exception.jsp</location>
</error-page>
<error-page>
	<error-code>500</error-code>
	<location>/exception.jsp</location>
</error-page>

```