Questo contenuto non è disponibile nella lingua selezionata.

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.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat