Search

4.3.2. Session Expired Handling

download PDF
You can also redefine the onExpired framework method that is called on the SessionExpiration event.
Example:
A4J.AJAX.onExpired = function(loc, expiredMsg){
    if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){
      return loc;
    } else {
     return false;
    }
}
This function can take the following parameters:
loc
the URL of the current page (can be updated on demand)
expiredMsg
a default message for display in the event of SessionExpiration.

Note

Customized onExpire handlers do not work under MyFaces. MyFaces handles exceptions by internally generating a debug page. To prevent this behavior, use the following:
...
<context-param>
	<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
	<param-value>false</param-value>
</context-param> 
...
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.