我正处于为 Web 应用程序编写自定义错误页面的情况(主要是为了减少 servlet 容器的默认错误页面的信息泄露)。因为我需要每个错误状态代码的错误页面,所以我将不得不对每个代码做出合理的响应。据我所知,这些错误页面不必对用户特别友好,但简单地将所有内容重定向到一个“出错了”错误页面将使诊断问题变得非常困难。
So I'm wondering if there is a Java
library that provides a good mapping
between HTTP status codes and a brief
human-readable description of them
(ideally a 2-4 word "summary", for use
as a page title, as well as a 1-3
sentence message expanding on the
summary).