Anonymous avatar Anonymous committed 18cbdbc

Better debugging information so that you can figure out what packages and actions were loaded (from painful experience this is very useful!)

The only thing I can't get it to do (needed!) is to say _exactly_ where the xwork.xml file was loaded from - I think we might need to modify OSCore to print that debug information?

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@126 e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (3)

src/java/com/opensymphony/xwork/config/entities/ActionConfig.java

 
         return result;
     }
+
+
+    public String toString() {
+        return "{ActionConfig " + clazz.getName() + (methodName != null ? "." + methodName + "()" : "") + "}";
+    }
 }

src/java/com/opensymphony/xwork/config/entities/PackageConfig.java

     }
 
     public String toString() {
-        return "{" + super.toString() + " Name:" + name + " abstract:" + isAbstract + " namespace:" + namespace + " parents:" + parents + "}";
+        return "{PackageConfig Name:" + name + " namespace:" + namespace + " abstract:" + isAbstract + " parents:" + parents + "}";
     }
 }

src/java/com/opensymphony/xwork/config/providers/XmlConfigurationProvider.java

 
         ActionConfig actionConfig = new ActionConfig(methodName, clazz, actionParams, results, interceptorList);
         packageContext.addActionConfig(name, actionConfig);
+
+        if (LOG.isDebugEnabled())
+            LOG.debug("Loaded " + (TextUtils.stringSet(packageContext.getNamespace()) ? packageContext.getNamespace() + "/" : "")
+                    + name + " in '" + packageContext.getName() + "' package:" + actionConfig);
     }
 
     /**
     protected void addPackage(Element packageElement) throws ConfigurationException {
         PackageConfig newPackage = buildPackageContext(packageElement);
 
+        if (LOG.isDebugEnabled())
+            LOG.debug("Loaded " + newPackage);
+
         // add result types (and default result) to this package
         addResultTypes(newPackage, packageElement);
 
     //    }
     private void loadConfigurationFile(String fileName, DocumentBuilder db) {
         if (!includedFileNames.contains(fileName)) {
+            if (LOG.isDebugEnabled())
+                LOG.debug("Loading xwork configuration from: " + fileName);
             includedFileNames.add(fileName);
 
             Document doc = null;
                     }
                 }
             }
-        }
 
-        //        loadPackages(rootElement);
-        //        loadIncludes(rootElement, db);
+            if (LOG.isDebugEnabled())
+                LOG.debug("Loaded xwork configuration from: " + fileName);
+        }
     }
 
     /**
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.