Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getCallerPrincipal in Managed Bean

 
Pasquale Imbemba
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

in EJB I can use getCallerPrincipal() from javax.ejb.SessionContext; I wonder how to get this information when I just use JSF, i.e. from within a Managed Bean only?

I appreciate any help.

Thanks,
~pi4630

 
Pasquale Imbemba
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will do the trick:

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18169
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually put this kind of code in a special "JSFUtils" class in order to keep the bulk of the code framework-independent. But yes, that's the function you need.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic