Two Laptop Bag*
The moose likes JSF and the fly likes Why does FacesContext .getCurrentInstance() return null? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Why does FacesContext .getCurrentInstance() return null?" Watch "Why does FacesContext .getCurrentInstance() return null?" New topic
Author

Why does FacesContext .getCurrentInstance() return null?

Darrin Smith
Ranch Hand

Joined: Aug 04, 2003
Posts: 276
I have a servlet (several actually) in a JSF application that I need to gain access to the FacesContext in.

I noticed that often when I call FacesContext .getCurrentInstance() it will return null.

Now, it is my understanding that as long as a JSF page within my application had been called previously, then the FacesContext should have been set up. Is this not the case?

Any clues as to why the context is null?

This is driving my nuts!
[ December 02, 2005: Message edited by: Darrin Smith ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why does FacesContext .getCurrentInstance() return null?
 
Similar Threads
Using imageCropper with JSF and primefaces
Get Request
Using FacesCcntext within Listeners and Filters
How can I access JSF managed bean from JSF converter?
[Resolved] Services as Managed Beans