This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes getCallerPrincipal in Managed Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "getCallerPrincipal in Managed Bean" Watch "getCallerPrincipal in Managed Bean" New topic
Author

getCallerPrincipal in Managed Bean

Pasquale Imbemba
Greenhorn

Joined: Feb 08, 2012
Posts: 5

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

Joined: Feb 08, 2012
Posts: 5

This will do the trick:

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: getCallerPrincipal in Managed Bean
 
Similar Threads
Accessing jsf bean from another jsf bean
Confirm message on submit
Calling getCallerPrincipal method..
Problem with initializing managed-property parameter
run-as question.