Gestión de excepciones y fin de sesión

This commit is contained in:
Marcos Garcia Nuñez
2019-12-19 00:09:48 +01:00
parent 25a4896426
commit 01f0f5627f
5 changed files with 54 additions and 22 deletions

View File

@@ -2,4 +2,10 @@
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd" version="2.3">
<!-- <factory> -->
<!-- <exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory> -->
<!-- </factory> -->
<factory>
<exception-handler-factory>org.omnifaces.exceptionhandler.FacesMessageExceptionHandlerFactory</exception-handler-factory>
</factory>
</faces-config>

View File

@@ -18,7 +18,10 @@
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
@@ -59,14 +62,29 @@
<url-pattern>*.xhtml</url-pattern>
</servlet-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>
<location>/error.xhtml?type=sql</location>
</error-page>
<error-page>
<exception-type>java.lang.RuntimeException</exception-type>
<location>/error.xhtml?type=runtime</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>
<session-timeout>1</session-timeout>
</session-config>
<!-- The Welcome File List -->