JSF 2 ajax buttons do not make server calls after session timeout

My application authenticates with RSA authentication manager

As soon as the user logged in, his user logon was extracted from the request header, the role is determined from the LDAP search. then this role is used by the JSF2 application to display specific sections on the page and other authorization-dependent areas.

(Note: instead of RSA, this may also use Tivoli).

The application timeout is controlled by the web.xml session time value, which is currently set to 30 minutes. And the RSA latency was set to 2 minutes (for testing). When the RSA session expires before the application session, and the user has performed any server operation, such as clicking a button, the user is automatically redirected to the login page through RSA. It worked fine.

AFter I added ajax functions for some buttons in the application using the following f tag: ajax

<h: commandLink id = "todayOrdersLink" value = "someValue" action = "# {SomeAction}" onclick = "clearAllElementsInHiddenDivs ('confirmSearch');> <f: ajax execute =" @form "onevent =" showWorkingIndicator "/" > </ h: commandLink>

now that the RSA session is expiring and I click on such a button, the server is not called by the button, it rather shows a javascript popup with invalid XML: The document is empty.

However, if I press the F5 button or the browser update button to force a server call, the earlier forwarding behavior to the login page still works. I must somehow be able to make a server call with ajaxified buttons after the end of the RSA session.

Any help would be appreciated.

+4
source share
1 answer

This is because the view no longer exists, and the server cannot recreate the view on the server to run ajax, you can try something like this:

var onError = function onError() { window.location = 'http://domain.com/loginPage.jsf'; }; jsf.ajax.addOnError(onError); 
+2
source

All Articles