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

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Nov 14 00:59:09 EST 2008


Author: shane.bryzak at jboss.com
Date: 2008-11-14 00:59:09 -0500 (Fri, 14 Nov 2008)
New Revision: 9563

Modified:
   trunk/src/main/org/jboss/seam/deployment/FileDescriptor.java
   trunk/src/main/org/jboss/seam/util/Resources.java
Log:
JBSEAM-3589

Modified: trunk/src/main/org/jboss/seam/deployment/FileDescriptor.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/FileDescriptor.java	2008-11-14 05:30:17 UTC (rev 9562)
+++ trunk/src/main/org/jboss/seam/deployment/FileDescriptor.java	2008-11-14 05:59:09 UTC (rev 9563)
@@ -2,6 +2,9 @@
 
 import java.net.URL;
 
+import org.jboss.seam.contexts.ServletLifecycle;
+import org.jboss.seam.util.Resources;
+
 public class FileDescriptor
 {
    
@@ -21,7 +24,7 @@
       {
          throw new NullPointerException("Name cannot be null, loading from " + classLoader);
       }
-      this.url = classLoader.getResource(name);
+      this.url = Resources.getResource(name, ServletLifecycle.getServletContext());
       if (this.url == null)
       {
          throw new NullPointerException("Cannot find URL from classLoader for " + name + ", loading from " + classLoader);

Modified: trunk/src/main/org/jboss/seam/util/Resources.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Resources.java	2008-11-14 05:30:17 UTC (rev 9562)
+++ trunk/src/main/org/jboss/seam/util/Resources.java	2008-11-14 05:59:09 UTC (rev 9563)
@@ -43,6 +43,11 @@
 
    public static URL getResource(String resource, ServletContext servletContext) 
    {
+      if (!resource.startsWith("/"))
+      {
+         resource = "/" + resource;
+      }
+      
       String stripped = resource.startsWith("/") ? 
             resource.substring(1) : resource;
    




More information about the seam-commits mailing list