You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mc...@apache.org on 2009/07/13 22:56:45 UTC

svn commit: r793710 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java

Author: mconcini
Date: Mon Jul 13 20:56:45 2009
New Revision: 793710

URL: http://svn.apache.org/viewvc?rev=793710&view=rev
Log:
MYFACES-2287 - Need to add a couple of Null checks in FacesConfigurator or apps that don't include a faces-config.xml (e.g. myfaces example apps) will blow up when starting.  

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=793710&r1=793709&r2=793710&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java Mon Jul 13 20:56:45 2009
@@ -430,12 +430,24 @@
             
             //4. Retrieve webAppFacesConfig
             FacesConfig webAppFacesConfig = getWebAppConfig();
-            
+
+            System.out.println("testing webappfacesconfig");
             //read metadata-complete attribute on WEB-INF/faces-config.xml
-            metadataComplete = Boolean.valueOf(webAppFacesConfig.getMetadataComplete());
+            if(webAppFacesConfig != null)
+            {
+                System.out.println("webapp facesconfig was not null");
+                metadataComplete = Boolean.valueOf(webAppFacesConfig.getMetadataComplete());    
+            }
+            else
+            {
+                System.out.println("webapp facesconfig was null");
+                metadataComplete = false;   //assume false if no faces-config.xml was found
+                                            //metadata-complete can only be specified in faces-config.xml per the JSF 2.0 schema 
+            }
+            
             
             //5. Ordering of Artifacts (see section 11.4.7 of the spec)
-            orderAndFeedArtifacts(appConfigResources,webAppFacesConfig);
+            orderAndFeedArtifacts(appConfigResources,webAppFacesConfig); 
 
             if (log.isInfoEnabled())
             {
@@ -855,7 +867,11 @@
                 getDispenser().feed(resource);
             }            
         }
-        getDispenser().feed(webAppConfig);
+        
+        if(webAppConfig != null)    //add null check for apps which don't have a faces-config.xml (e.g. tomahawk examples for 1.1/1.2)
+        {
+            getDispenser().feed(webAppConfig);
+        }
     }
 
     /**