Search to more jars and fix testcase!
authorpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 3 May 2010 09:44:39 +0000 (09:44 +0000)
committerpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 3 May 2010 09:44:39 +0000 (09:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@940405 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/naming/resources/BaseDirContext.java
test/org/apache/catalina/core/TestStandardContextResources.java
test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar

index 1c48fe5..b388050 100644 (file)
@@ -456,9 +456,13 @@ public abstract class BaseDirContext implements DirContext {
         
         // Check the alternate locations
         for (DirContext altDirContext : altDirContexts) {
-            obj = altDirContext.lookup("META-INF/resources/" + name);
-            if (obj != null)
-                return obj;
+            try {
+                obj = altDirContext.lookup("META-INF/resources/" + name);
+                if (obj != null)
+                    return obj;
+            } catch ( NamingException ex) {
+                // ignore
+            }
         }
         
         // Really not found
index 92206d0..6a1fde1 100644 (file)
@@ -84,7 +84,7 @@ public class TestStandardContextResources extends TomcatBaseTest {
         tomcat.start();
 
         assertPageContains("/test/getresource?path=/resourceF.jsp",
-                "<p>resourceF.jsp in the web application</p>");
+                "<p>resourceF.jsp in resources2.jar</p>");
         assertPageContains("/test/getresource?path=/resourceA.jsp",
                 "<p>resourceA.jsp in the web application</p>");
         assertPageContains("/test/getresource?path=/resourceB.jsp",
index 6615576..62a41a9 100644 (file)
Binary files a/test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar and b/test/webapp-3.0-fragments/WEB-INF/lib/resources2.jar differ