[ 
https://issues.apache.org/jira/browse/MYFACES-2730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880834#action_12880834
 ] 

Jakob Korherr commented on MYFACES-2730:
----------------------------------------

Committed solution for this issue. A few words about it:

Since FacesContext and ExternalContext are now available at system startup and 
shutdown, we could get rid of some previous hacks. One of them (the biggest) 
was in AbstractFacesInitializer and caused some problems like MYFACES-2520, 
because it used the FacesContextFactory and dummy Request- and Response classes 
to get a FacesContext instance for the system event management (MyFaces core 
itself does not access the request and response objects directly in 
FacesContextFactoryImpl, but Trinidad does and this caused some problems). Also 
those dummy classes caused some Servlet 3.0 related problems. With this 
solution in place, I could remove this code completely.

Furthermore I introduced a new base implementation class for ExternalContext 
called ServletExternalContextImplBase. It contains all ExternalContext methods 
which only rely on the ServletContext. The class is used as a base class for 
StartupServletExternalContextImpl and ServletExternalContextImpl, thus 
eliminating any redundancy between the startup and the normal ExternalContext 
implementation.

> FacesContext not available on application startup
> -------------------------------------------------
>
>                 Key: MYFACES-2730
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2730
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127, JSR-252, JSR-314
>    Affects Versions: 1.1.8, 1.2.9, 2.0.0
>            Reporter: Nick Belaevski
>            Assignee: Jakob Korherr
>
> If custom ResourceHandler calls FacesContext.getCurrentInstance() in 
> constructor to read init parameters, null value is returned. This affects 
> latest MyFaces 2.0.0-SNAPSHOT. Mojarra 2.0 provides InitFacesContext in this 
> case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to