You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2007/01/16 14:24:32 UTC

svn commit: r496680 - /myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java

Author: matzew
Date: Tue Jan 16 05:24:31 2007
New Revision: 496680

URL: http://svn.apache.org/viewvc?view=rev&rev=496680
Log:
calling setServletContext() after init is done

Modified:
    myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java

Modified: myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java?view=diff&rev=496680&r1=496679&r2=496680
==============================================================================
--- myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java (original)
+++ myfaces/core/branches/jsf12/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java Tue Jan 16 05:24:31 2007
@@ -20,6 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.application.ApplicationImpl;
 import org.apache.myfaces.config.FacesConfigValidator;
 import org.apache.myfaces.config.FacesConfigurator;
 import org.apache.myfaces.context.servlet.ServletExternalContextImpl;
@@ -27,6 +28,8 @@
 import org.apache.myfaces.shared_impl.webapp.webxml.WebXml;
 
 import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
 import javax.faces.context.ExternalContext;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
@@ -85,6 +88,12 @@
                 WebXml.init(externalContext);
 
                 servletContext.setAttribute(FACES_INIT_DONE, Boolean.TRUE);
+                
+                Application application = ((ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
+                if(application instanceof ApplicationImpl)
+                {
+                    ((ApplicationImpl) application).setServletContext(servletContext);
+                }
             }
             else
             {