Author: shane.bryzak(a)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;