Este contenido no está disponible en el idioma seleccionado.

4.3. Request Errors and Session Expiration Handling


RichFaces lets you redefine the standard handlers responsible for processing exceptions. We recommend defining your own JavaScript, which will be executed when exceptional situations occur.
Add the following code to web.xml:
<context-param>
	<param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
	<param-value>true</param-value>
</context-param>
Copy to Clipboard Toggle word wrap

4.3.1. Request Errors Handling

To execute your own code on the client in the event of an error during an AJAX request, you must redefine the standard A4J.AJAX.onError method like so:
 A4J.AJAX.onError = function(req, status, message){
    window.alert("Custom onError handler "+message);
}
Copy to Clipboard Toggle word wrap
This function accepts the following as parameters:
req
a parameter string of a request that calls an error
status
the number of an error returned by the server
message
a default message for the given error
Therefore, you can create your own handler that is called when timeouts, internal server errors, etc. occur.
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba