Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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
Bartender
Posts: 18423
60
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!