更新时间:2023-09-04 19:13:58
尝试将以下代码段放在 WEB-INF / web.xml中
Try putting the following snippet in your WEB-INF/web.xml
<error-page>
<error-code>500</error-code>
<location>/Error.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/Error.jsp</location>
</error-page>
在这种情况下, Error.jsp
是与 WEB-INF
目录(不在其中)相同的级别。
In this case Error.jsp
is at the same level as WEB-INF
directory (not inside it).