Yes it can, here is a good link:

http://jsffaq.com/Wiki.jsp?page=HowToAccessOneManagedBeanFromAnotherMana
gedBean

<evangelism>BTW, Shale simplifies this for you</evangelism>

 

-----Original Message-----
From: Mike Duffy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 17, 2006 10:43 AM
To: [email protected]
Subject: Can the FacesContext be Accessed from Outside of a Backing
Bean?

If I call the following from inside a backing bean, everything works
fine:

User user = (User)
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().g
et(Constants.USER_KEY); 

However, if I make the same call from an object in the session or from a
utilty class, I get a null pointer on
"FacesContext.getCurrentInstance()". 

Can the FacesContext be accessed from outside of a backing bean?

Thx.

Mike

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

Reply via email to