This content has been marked as final.
Show 5 replies
-
1. Re: Getting Seam component (Identity) in an entity listener
clerum May 18, 2009 6:05 PM (in response to monkeyden)Have you tried (Identity)Component.getInstance("identity")
-
2. Re: Getting Seam component (Identity) in an entity listener
monkeyden May 18, 2009 7:41 PM (in response to monkeyden)I did indeed.
@PrePersist public void prePersist(Auditable auditable) { String username = "ADMIN_SYSTEM"; Identity identity = (Identity)Component.getInstance("identity"); if (identity.getUsername() != null) { username = identity.getUsername(); } auditable.setLastUpdatedBy(username); }
Still null.
-
3. Re: Getting Seam component (Identity) in an entity listener
william.drai May 18, 2009 10:50 PM (in response to monkeyden)We use this :
Contexts.getSessionContext().get("org.jboss.seam.security.identity")
-
4. Re: Getting Seam component (Identity) in an entity listener
monkeyden May 20, 2009 6:07 PM (in response to monkeyden)Thanks for the reply William. That also did not work for me. We are also using the portlet bridge. I'm wondering if there is something going on with that, though I have no specific evidence to suggest it. It's just an odd piece of the puzzle.
-
5. Re: Getting Seam component (Identity) in an entity listener
daxxy Jul 28, 2010 8:07 AM (in response to monkeyden)Did you ever figure this out? I am in the same boat and just posted about it to the envers forum.