Good morning, JSF experts!
Let me fugure out the problem I\'m trying to solve. The application has many forms. And elements in forms can be marked to require authorizati
That's the PostAddToViewEvent of the UIViewRoot itself. You can hook into it using a SystemEventListener implementation like below:
public class YourSystemEventListener implements SystemEventListener {
@Override
public boolean isListenerForSource(Object source) {
return (source instanceof UIViewRoot);
}
@Override
public void processEvent(SystemEvent event) throws AbortProcessingException {
UIViewRoot view = (UIViewRoot) event.getSource();
// ...
}
}
Which is registered in <application>
of faces-config.xml
like below:
<system-event-listener>
<system-event-listener-class>com.example.YourSystemEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.PostAddToViewEvent</system-event-class>
<source-class>javax.faces.component.UIViewRoot</source-class>
</system-event-listener>