I've tried to implement the custom RevisionListener exactly as you have it in your example, but the components are not found apparently. Here is the code
public void newRevision(Object revisionEntity) {
Identity id = (Identity) Component.getInstance("org.jboss.seam.security.Identity");
IdentityRevisionEntity revEntity = (IdentityRevisionEntity) revisionEntity;
revEntity.setUsername(id.getPrincipal().toString());
}
I get a NullPointerException on the id. And yet when I look at the debug page, that component definitely exists in the session context. I've tried to use Component.getInstance() on other components and each time I get null. I've tried explicitly stating in which context to find the component. Nothing.
I must be missing something crucial here. Any idea what?
TDR