【发布时间】:2011-03-07 12:38:26
【问题描述】:
我怎样才能抓到
com.sun.faces.context.FacesFileNotFoundException
在 Java EE Web 应用程序中?
我尝试在我的 web.xml 文件中添加以下行,但没有成功:
...
<error-page>
<error-code>404</error-code>
<location>/404.jsf</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/404.jsf</location>
</error-page>
<error-page>
<exception-type>FacesFileNotFoundException</exception-type>
<location>/404.jsf</location>
</error-page>
<error-page>
<exception-type>FileNotFoundException</exception-type>
<location>/404.jsf</location>
</error-page>
<error-page>
<exception-type>FailingHttpStatusCodeException</exception-type>
<location>/404.jsf</location>
</error-page>
</web-app>
【问题讨论】:
标签: exception jsf jakarta-ee try-catch filenotfoundexception