[weld-issues] [JBoss JIRA] Created: (WELD-730) WeldApplication should not assume FacesContext is always active

Dan Allen (JIRA) jira-events at lists.jboss.org
Fri Oct 15 19:16:40 EDT 2010


WeldApplication should not assume FacesContext is always active
---------------------------------------------------------------

                 Key: WELD-730
                 URL: https://jira.jboss.org/browse/WELD-730
             Project: Weld
          Issue Type: Bug
          Components: Servlet Container Support
    Affects Versions: 1.1.0.Beta1
            Reporter: Dan Allen
             Fix For: 1.1.0.Beta2


WeldApplication uses a forwarding wrapper around the delegate JSF Application object in order to get around the fact that BeanManager may not have been initialized at the time JSF is initializing. However, it assumes that the first use of Application will be during a faces request, where FacesContext is available. However, the JSF Application object is permitted to be accessed outside of the faces lifecycle (such as in a Servlet filter). When this occurs, a NullPointerException in WeldApplication results.

WeldApplication should skip the BeanManager lookup if the FacesContext is null.

private BeanManager beanManager()
{
   FacesContext facesContext;
   if (beanManager != null && (facesContext = FacesContext.getCurrentInstance()) != null) {
      // lookup BeanManager
   }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list