[jboss-cvs] JBossAS SVN: r62652 - in branches/Branch_4_2/tomcat/src/main/org/jboss/web: tomcat/service/jasper and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 30 13:56:14 EDT 2007


Author: stan.silvert at jboss.com
Date: 2007-04-30 13:56:13 -0400 (Mon, 30 Apr 2007)
New Revision: 62652

Modified:
   branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java
   branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/jasper/JspServletOptions.java
Log:
JBAS-4383


Modified: branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java
===================================================================
--- branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java	2007-04-30 17:23:31 UTC (rev 62651)
+++ branches/Branch_4_2/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java	2007-04-30 17:56:13 UTC (rev 62652)
@@ -37,17 +37,26 @@
  */
 public class JBossJSFConfigureListener extends ConfigureListener 
 {
-    
+    private static final String WAR_BUNDLES_JSF_IMPL = "org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL";
+
     private static Logger LOG = Logger.getLogger(JBossJSFConfigureListener.class);
     
     public static final String SHOULD_LOG_CONFIG_MESSAGES = "com.sun.faces.displayConfiguration";
     
+    
     private ServletContext servletContext;
     
+    public static boolean warBundlesJSFImpl(ServletContext servletContext)
+    {
+       String bundledJSFImpl = servletContext.getInitParameter(WAR_BUNDLES_JSF_IMPL);
+       return (bundledJSFImpl != null) && bundledJSFImpl.equalsIgnoreCase("true");
+    }
+
     @Override
     public void contextInitialized(ServletContextEvent event) 
     {
         this.servletContext = event.getServletContext();
+        if (warBundlesJSFImpl(this.servletContext)) return;
         
         // If the pluginClass is not set, assume Log4J
         if (System.getProperty("org.jboss.logging.Logger.pluginClass") == null) 
@@ -67,7 +76,7 @@
             Thread.currentThread()
                   .getContextClassLoader()
                   .loadClass("org.apache.myfaces.webapp.StartupServletContextListener");
-            LOG.warn("MyFaces JSF implementation found!  This version of JBoss AS ships with the java.net implementation of JSF.  There are known issues when mixing JSF implementations.  This warning does not apply to MyFaces component libraries such as Tomahawk.  However, myfaces-impl.jar and myfaces-api.jar should not be used without surgical removal of the java.net JSF implementation.  See the JBoss wiki for more details.");
+            LOG.warn("MyFaces JSF implementation found!  This version of JBoss AS ships with the java.net implementation of JSF.  There are known issues when mixing JSF implementations.  This warning does not apply to MyFaces component libraries such as Tomahawk.  However, myfaces-impl.jar and myfaces-api.jar should not be used without disabling the built-in JSF implementation.  See the JBoss wiki for more details.");
         }
         catch (ClassNotFoundException e)
         {

Modified: branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/jasper/JspServletOptions.java
===================================================================
--- branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/jasper/JspServletOptions.java	2007-04-30 17:23:31 UTC (rev 62651)
+++ branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/jasper/JspServletOptions.java	2007-04-30 17:56:13 UTC (rev 62652)
@@ -32,6 +32,7 @@
 import org.apache.jasper.compiler.TagPluginManager;
 import org.apache.jasper.compiler.Localizer;
 import org.jboss.logging.Logger;
+import org.jboss.web.jsf.integration.config.JBossJSFConfigureListener;
 
 /**
  * Override the default JspServletOptions to externalize the jsp layer
@@ -790,7 +791,7 @@
       {
          String name = base + count;
          jarPath = config.getInitParameter(name);
-         if( jarPath != null )
+         if( (jarPath != null) && okToAddTagsFromJSFLibs(jarPath, context) )
             tldJars.add(jarPath);
          count ++;
       } while( jarPath != null );
@@ -804,4 +805,12 @@
       tagPluginManager = new TagPluginManager(context);
    }
 
+   private boolean okToAddTagsFromJSFLibs(String jarPath, ServletContext context)
+   {
+      // if it's not coming from jsf-libs you can always add it
+      if (!jarPath.startsWith("jsf-libs")) return true;
+
+      return !JBossJSFConfigureListener.warBundlesJSFImpl(context);
+   }
+
 }




More information about the jboss-cvs-commits mailing list