Mejora en la gestión de excepciones y errores. Nuevo managedBean para

gestión de errores anto AJAX como en peticiones normales.
This commit is contained in:
Marcos Garcia Nuñez
2020-01-01 21:42:31 +01:00
parent 7e04274255
commit 75ed5e2635
5 changed files with 257 additions and 199 deletions

View File

@@ -24,7 +24,7 @@
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
@@ -52,46 +52,11 @@
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- Filters -->
<filter>
<filter-name>facesExceptionFilter</filter-name>
<filter-class>org.omnifaces.filter.FacesExceptionFilter</filter-class>
</filter>
<!-- Filter mappings -->
<filter-mapping>
<filter-name>facesExceptionFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Error pages mapping -->
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/error.xhtml?type=expired</location>
</error-page>
<error-page>
<exception-type>java.sql.SQLException</exception-type>
<exception-type>org.hibernate.exception.GenericJDBCException</exception-type>
<exception-type>java.net.ConnectException</exception-type>
<exception-type>javax.persistence.PersistenceException</exception-type>
<location>/error.xhtml?type=sql</location>
</error-page>
<error-page>
<exception-type>javax.persistence.PersistenceException</exception-type>
<location>/error.xhtml?type=runtime</location>
</error-page>
<error-page>
<exception-type>java.net.ConnectException</exception-type>
<location>/error.xhtml?type=sql</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.xhtml</location>
</error-page>
<error-page>
<error-code>401</error-code>
<location>/error.xhtml?type=expired</location>
</error-page>
<session-config>
<session-timeout>30</session-timeout>