dev@javaserverfaces.java.net

[Fwd: [REVIEW] Use GlassFish's default-web.xml for default configuration]

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 31 May 2006 09:52:33 -0700

Resending as it appears the message didn't make it through.

-------- Original Message --------
Subject: [REVIEW] Use GlassFish's default-web.xml for default
configuration
Date: Tue, 30 May 2006 17:34:53 -0700
From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
To: dev_at_javaserverfaces.dev.java.net



Thanks to Stan for reminding me of the feature.

Use GlassFish's default-web.xml for global web application configuration.

Updates to GlassFish's default-web.xml will happen at a later date.

Add the following context params to
<GLASSFISH_HOME>/domains/domain1/config/default-web.xml
in order to get the unit tests to pass:
  - com.sun.faces.injectionProvider =
com.sun.faces.vendor.GlassFishInjectionProvider
  - com.sun.faces.validateXml = true
  - com.sun.faces.forceLoadConfiguration = true


SECTION: Modified Files
----------------------------
M com/sun/faces/config/ConfigureListener.java
 - remove the scanWebXml property

M com/sun/faces/config/WebConfiguration.java
 - rename com.sun.faces.InjectionProvider to
   com.sun.faces.injectionProvider to be consistent

M com/sun/faces/spi/InjectionProviderFactory.java
 - removed logic that would try to detect if we
   were running within GlassFish


R com/sun/faces/config/GlassFishConfigureListener.java
 - no longer necessary


SECTION: Diffs
----------------------------
Index: com/sun/faces/config/ConfigureListener.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/config/ConfigureListener.java,v
retrieving revision 1.79
diff -u -r1.79 ConfigureListener.java
--- com/sun/faces/config/ConfigureListener.java 25 May 2006 21:02:26
-0000 1.79
+++ com/sun/faces/config/ConfigureListener.java 31 May 2006 00:23:27
-0000
@@ -259,11 +259,7 @@

    private VariableResolver legacyVRChainHead = null;
    private PropertyResolver legacyPRChainHead = null;
- private ArrayList<ELResolver> elResolversFromFacesConfig = null;
-
- // flag to disable web.xml scanning completely - to be used
- // by subclasses of ConfigureListener.
- private boolean shouldScanWebXml = true;
+ private ArrayList<ELResolver> elResolversFromFacesConfig = null;
   
    
    // ------------------------------------------
ServletContextListener Methods
@@ -346,8 +342,7 @@
            // Check to see if the FacesServlet is present in the
            // web.xml. If it is, perform faces configuration as normal,
            // otherwise, simply return.
- if (shouldScanWebXml &&
-
!isFeatureEnabled(BooleanWebContextInitParameter.ForceLoadFacesConfigFiles))
+ if
(!isFeatureEnabled(BooleanWebContextInitParameter.ForceLoadFacesConfigFiles))
            {
                WebXmlProcessor processor = new WebXmlProcessor(context);
                if (!processor.isFacesServletPresent()) {
@@ -582,12 +577,7 @@
            FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        return afactory.getApplication();

- }
-
-
- protected void scanWebXml(boolean shouldScan) {
- this.shouldScanWebXml = shouldScan;
- }
+ }


    /**
Index: com/sun/faces/config/WebConfiguration.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/config/WebConfiguration.java,v
retrieving revision 1.5
diff -u -r1.5 WebConfiguration.java
--- com/sun/faces/config/WebConfiguration.java 22 May 2006 17:16:02
-0000 1.5
+++ com/sun/faces/config/WebConfiguration.java 31 May 2006 00:23:27 -0000
@@ -451,7 +451,7 @@
              NumberOfViews
        ),
        NumberOfLogicalViews(
- "numberOfLogicalViews",
+ "com.sun.faces.numberOfLogicalViews",
              "15"
        ),
        NumberOfLogicalViewsDeprecated(
@@ -461,7 +461,7 @@
              NumberOfLogicalViews
        ),
        InjectionProviderClass(
- "com.sun.faces.InjectionProvider",
+ "com.sun.faces.injectionProvider",
                ""
        ),
        ResponseBufferSize(
Index: com/sun/faces/spi/InjectionProviderFactory.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/spi/InjectionProviderFactory.java,v
retrieving revision 1.3
diff -u -r1.3 InjectionProviderFactory.java
--- com/sun/faces/spi/InjectionProviderFactory.java 22 May 2006
15:05:57 -0000 1.3
+++ com/sun/faces/spi/InjectionProviderFactory.java 31 May 2006
00:23:27 -0000
@@ -25,14 +25,15 @@

package com.sun.faces.spi;

-import com.sun.faces.config.WebConfiguration;
-import com.sun.faces.config.WebConfiguration.WebContextInitParameter;
+import javax.faces.context.ExternalContext;
+
import java.util.logging.Level;
import java.util.logging.Logger;

import com.sun.faces.RIConstants;
+import com.sun.faces.config.WebConfiguration;
+import com.sun.faces.config.WebConfiguration.WebContextInitParameter;
import com.sun.faces.util.Util;
-import javax.faces.context.ExternalContext;

/**
 * <p>A factory for creating <code>InjectionProvider</code>
@@ -122,17 +123,8 @@
                    LOGGER.log(Level.SEVERE, "", iae);
                }
            }
- } else {
- // added magic for GlassFish
- try {
- if
(Class.forName("com.sun.enterprise.util.InjectionManagerImpl") != null) {
- provider =
-
getProviderInstance("com.sun.faces.vendor.GlassFishInjectionProvider");
- }
- } catch (ClassNotFoundException cnfe) {
- provider = NOOP_PROVIDER;
- }
- }
+ }
+
        return provider;
    }