web.xml error-page 不起作用解决方案

本文解决了一个常见问题:在web.xml中配置错误页面跳转至特定JSP文件却未能生效的情况。通过调整浏览器设置及确保目标文件大小超过1024字节解决了此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天遇到一个问题(应该是个老问题,但网上答案各异),记录下来
在web.xml中配置错误页面跳转如下:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/err/error.jsp</location>
</error-page>
或者
<error-page>
<error-code>500</error-code>
<location>/err/error.jsp</location>
</error-page>
制造空指针异常,启动tomcat服务器发现并不能跳转到error.jsp,而是跳转到IE的错误提示页面

解决方案:
1.在IE【工具】->【Internet选项】->【高级】中勾掉【显示友好http错误提示】;
2.确保error.jsp的大小>1024字节。
]. The system is vulnerable to security attacks, since it trusts certificates signed by the demo trusted CA.> <Mar 17, 2025 5:13:50,408 PM CST> <Warning> <HTTP> <BEA-101403> <For security constraint with url-pattern /* in web application rtgsMOP.war, only the http methods "TRACE HEAD PURGE LOCK PROPFIND UNLINK COPY OPTIONS VIEW PUT PATCH DELETE LINK UNLOCK " are covered.> <Mar 17, 2025 5:13:51,500 PM CST> <Warning> <HTTP> <BEA-101403> <For security constraint with url-pattern /* in web application bankMOP.war, only the http methods "TRACE HEAD PURGE LOCK PROPFIND UNLINK COPY OPTIONS VIEW PUT PATCH DELETE LINK UNLOCK " are covered.> <Mar 17, 2025 5:13:52,098 PM CST> <Critical> <HTTP> <BEA-101024> <[ServletContext@1374383048[app:bankMOP module:bankMOP.war path:null spec-version:4.0]] Unsupported error status code for the error-page element in web.xml. java.lang.ArrayIndexOutOfBoundsException: -99 at weblogic.servlet.internal.ErrorManager.registerError(ErrorManager.java:51) at weblogic.servlet.internal.ErrorManager.registerErrorPages(ErrorManager.java:87) at weblogic.servlet.internal.WebAppServletContext.activateFromDescriptors(WebAppServletContext.java:1199) at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3241) at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1879) Truncated. > <Mar 17, 2025 5:13:52,099 PM CST> <Critical> <HTTP> <BEA-101024> <[ServletContext@1150367507[app:rtgsMOP module:rtgsMOP.war path:null spec-version:4.0]] Unsupported error status code for the error-page element in web.xml. java.lang.ArrayIndexOutOfBoundsException: -99 at weblogic.servlet.internal.ErrorManager.registerError(ErrorManager.java:51) at weblogic.servlet.internal.ErrorManager.registerErrorPages(ErrorManager.java:87) at weblogic.servlet.internal.WebAppServletContext.activateFromDescriptors(WebAppServletContext.java:1199) at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3241) at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1879) Truncated. > <Mar 17, 2025 5:13:53,098 PM CST> <Warning> <HTTP> <BEA-101403> <For security constraint with url-pattern /* in web application rtgsMOP.war, only the http methods "TRACE HEAD PURGE LOCK PROPFIND UNLINK COPY OPTIONS VIEW PUT PATCH DELETE LINK UNLOCK " are covered.> <Mar 17, 2025 5:13:53,157 PM CST> <Warning> <HTTP> <BEA-101403> <For security constraint with url-pattern /* in web application bankMOP.war, only the http methods "TRACE HEAD PURGE LOCK PROPFIND UNLINK COPY OPTIONS VIEW PUT PATCH DELETE LINK UNLOCK " are covered.> 帮我分析一下这个weblogic server 启动日志
03-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值