This content has been marked as final.
Show 2 replies
-
1. Re: How to get CallerPrincipal in EJB3 session bean
dkalna Dec 1, 2006 2:02 AM (in response to enazareno)@Stateless
@Local
public class YourBean implements YourInterface {
@Resource
SessionContext ctx;
public void yourMethod() {
Principal callerPrincipal = ctx.getCallerPrincipal();
}
}
Basically, you have to use annotations like @javax.annotation.EJB and @javax.annotation.Resource to inject references to Java EE services directly into the fields of your bean.
Regards
Dalibor -
2. Re: How to get CallerPrincipal in EJB3 session bean
enazareno Dec 1, 2006 7:17 PM (in response to enazareno)ok thanks. I'll try it. Have a nice day.
Regards,
Elmo