Reputation: 5698
I am using this in a page:
<f:event type="preRenderView" listener="#{bean.logoutIfNotAuthenticated}"/>
it works. However, the listener is called after a action is called (for example, by clicking by a commandButton).
Is there a system-event which will be called at first?
I have tried it with "preValidate", but this will not work, if the form has no validation requirements.
Upvotes: 0
Views: 404
Reputation: 1
Although using filter is a good solution, preRenderView event should work properly and the listener should fire before the view is rendered. I used it many times to navigate away from the requested view in the event if the user does not have access to the requested page for example.
Upvotes: 0
Reputation: 1573
Why don't you try to use filters to achieve the session management?, that way all request could get automaticly and then being redirected or processed
Upvotes: 1