Commits

Anonymous committed 7f4aff3

Comments (0)

Files changed (2)

src/java/com/opensymphony/webwork/quickstart/Configuration.java

             String dir = mapping.getDir();
             dir = resolveDir(dir, wd);
 
+            // if the ${dir}/WEB-INF/classes dir exists and isn't already added to the classDirs, let's do it
+            // ... but make sure we put it at the front (to obey the class loading behaviors)
+            File classDir = new File(dir, "WEB-INF/classes");
+            if (classDir.exists()) {
+                String fullClassDir = getFullPath(classDir);
+                if (this.classDirs == null) {
+                    this.classDirs = new ArrayList();
+                }
+
+                if (!classDirs.contains(fullClassDir)) {
+                    classDirs.add(0, fullClassDir);
+                }
+            }
+
             if (this.mappings == null) {
                 this.mappings = new MultiHashMap();
                 this.pathPriority = new ArrayList();
             file = new File(dir);
         }
 
+        return getFullPath(file);
+    }
+
+    private String getFullPath(File file) {
         try {
             return file.getCanonicalPath();
         } catch (IOException e) {

webapps/showcase/quickstart.xml

     </sources>
 
     <!--
-    The classDirs directories can be a jar or a directory of classes
-    -->
+    The classDirs directories can be a jar or a directory of classes.
+    The WEB-INF/classes directory for each webDir (below) will automatically
+    be added if it exists.
+
     <classDirs>
         <dir>src/webapp/WEB-INF/classes</dir>
     </classDirs>
+    -->
 
     <!--
     You can specify one or more directories where your webapp files