[seam-commits] Seam SVN: r9116 - in trunk/src/main/org/jboss/seam: init and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Sep 23 09:45:59 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-09-23 09:45:59 -0400 (Tue, 23 Sep 2008)
New Revision: 9116

Modified:
   trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
   trunk/src/main/org/jboss/seam/init/Initialization.java
Log:
JBSEAM-3350

Modified: trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java	2008-09-23 13:25:48 UTC (rev 9115)
+++ trunk/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java	2008-09-23 13:45:59 UTC (rev 9116)
@@ -2,6 +2,9 @@
 
 import java.io.File;
 
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
 /**
  * A special deployment strategy that can be used to scan the war root. This
  * is treated as a special case. 
@@ -11,6 +14,8 @@
  */
 public class WarRootDeploymentStrategy extends DeploymentStrategy
 {
+   
+   private static LogProvider log = Logging.getLogProvider(WarRootDeploymentStrategy.class);
 
    private ClassLoader classLoader;
    
@@ -24,7 +29,15 @@
    {
       this.classLoader = classLoader;
       this.warRoot = new File[1];
-      this.warRoot[0] = warRoot; 
+      if (warRoot != null)
+      {
+         this.warRoot[0] = warRoot;
+      }
+      else
+      {
+         log.warn("Unable to discover war root, .page.xml files won't be found");
+         this.warRoot = new File[0];
+      }
       getDeploymentHandlers().put(DotPageDotXmlDeploymentHandler.NAME, new DotPageDotXmlDeploymentHandler());
    }
    

Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java	2008-09-23 13:25:48 UTC (rev 9115)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java	2008-09-23 13:45:59 UTC (rev 9116)
@@ -8,6 +8,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -733,9 +734,19 @@
       String realPath = servletContext.getRealPath(path);
       if (realPath==null) //WebLogic!
       {
-         log.debug("Could not find path for " + path);
+         try 
+         {
+            URL resourcePath = servletContext.getResource(path);
+            if (resourcePath.getProtocol().equals("file")) 
+            {
+               realPath = resourcePath.getPath();
+            }
+         }
+         catch (MalformedURLException e) {}
+
       }
-      else
+      
+      if (realPath != null)
       {
          File file = new File(realPath);
          if (file.exists())




More information about the seam-commits mailing list