This content has been marked as final.
Show 1 reply
-
1. Re: how to get username of logged in user
mimra Dec 15, 2006 3:46 AM (in response to lorandsm_)In your session bean you can use the following to the user name:
ejbContext.getCallerPrincipal()
To get the EJB context you can inject it using:@Resource SessionContext ejbContext;
You should really consider using an interceptor to perform audit logging to keep your business logic clean.
/Michael