Commits

Anonymous committed fd8a0d3

Implemented XW-244 (default to ActionSupport and 'success' if not specified).

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

Comments (0)

Files changed (1)

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

 
 import com.opensymphony.xwork.Action;
 import com.opensymphony.xwork.ObjectFactory;
+import com.opensymphony.xwork.ActionSupport;
 import com.opensymphony.xwork.config.*;
 import com.opensymphony.xwork.config.entities.*;
 
         //methodName should be null if it's not set
         methodName = (methodName.trim().length() > 0) ? methodName.trim() : null;
 
+        // if you don't specify a class on <action/>, it defaults to ActionSupport
+        if (!TextUtils.stringSet(className)) {
+            className = ActionSupport.class.getName();
+        }
+
         try {
             ActionConfig actionConfig = new ActionConfig(null, className, null, null, null);
             Action action = ObjectFactory.getObjectFactory().buildAction(actionConfig);
                 String resultName = resultElement.getAttribute("name");
                 String resultType = resultElement.getAttribute("type");
 
+                // if you don't specify a name on <result/>, it defaults to "success"
+                if (!TextUtils.stringSet(resultName)) {
+                    resultName = Action.SUCCESS;
+                }
+
                 if (!TextUtils.stringSet(resultType)) {
                     resultType = packageContext.getFullDefaultResultType();
                 }