[英]web.xml configuration to redirect to login page after session timeout in jsf
[英]Error Page configuration in web.xml for JSF application
我曾尝试使用error-page元素在web.xml中配置错误页面,但从未显示错误页面,而是以原始形式向查看应用程序的用户抛出了异常。
我该怎么办? 对于为什么会这样,我还没有发现任何线索。 任何帮助都非常感谢。
问候,Asif
您可以按如下所示为Exception
添加错误页面
<error-page>
<error-code>400</error-code>
<location>/400.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
<error-page>
<exception-type>your.company.YourException</exception-type>
<location>/errorPage.html</location>
</error-page>
如果要在所有类型的异常上显示错误页面,请重新检查Exception
类型,然后使用java.lang.Exception
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.