Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: rogerk
Reporter: pradeepk188
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

FacesContext.getCurrentInstance() returns null

Created: 28/Jun/10 07:03 AM   Updated: 29/Feb/12 09:36 PM   Resolved: 29/Feb/12 09:36 PM
Component/s: lifecycle
Affects Version/s: 1.2_04
Fix Version/s: None

Time Tracking:
Not Specified


Operating System: All
Platform: All

Issuezilla Id: 1,717
Status Whiteboard:

size_medium importance_small

Participants: Ed Burns, Manfred Riem, pradeepk188 and rogerk

 Description  « Hide

>>> java code
public class MyListener extends ConfigureListener{
public void contextInitialized(ServletContextEvent event) { super.contextInitialized(event); FacesContext context = FacesContext.getCurrentInstance(); }

>>> web.xml

The value of context is null.

Although the default implementation is called through the context
is not ready yet. I tried to search for this problem but could not find any

Ed Burns added a comment - 06/Jun/11 05:49 PM

Bulk assign all impl issues to Roger.

Manfred Riem added a comment - 29/Feb/12 09:36 PM

The FacesContext.getCurrentInstance is only guaranteed to be available within the scope of LifeCycle. Since you are calling the method outside of a LifeCycle there is no HTTP request and response that the FacesContext is associated with. As such that method is not available for usage.