Author: musachy
Date: Fri Jan  2 06:39:46 2009
New Revision: 730743

URL: http://svn.apache.org/viewvc?rev=730743&view=rev
Log:
WW-2944 when action is not found, use the specified "action" attribute, instead 
of the action name

Modified:
    
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java?rev=730743&r1=730742&r2=730743&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ServletUrlRenderer.java
 Fri Jan  2 06:39:46 2009
@@ -21,6 +21,17 @@
 
 package org.apache.struts2.components;
 
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.config.entities.ActionConfig;
+import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.util.logging.Logger;
+import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import org.apache.struts2.StrutsException;
+import org.apache.struts2.dispatcher.mapper.ActionMapper;
+import org.apache.struts2.dispatcher.mapper.ActionMapping;
+import org.apache.struts2.views.util.UrlHelper;
+
 import java.io.IOException;
 import java.io.Writer;
 import java.util.Collections;
@@ -28,18 +39,6 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-import org.apache.struts2.StrutsException;
-import org.apache.struts2.dispatcher.mapper.ActionMapping;
-import org.apache.struts2.dispatcher.mapper.ActionMapper;
-import org.apache.struts2.views.util.UrlHelper;
-
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
 /**
  * Implementation of the {...@link UrlRenderer} interface that creates URLs 
suitable in a servlet environment.
  * 
@@ -160,7 +159,7 @@
                        if (formComponent.getId() == null  && actionName!=null 
) {
                                formComponent.addParameter("id", 
formComponent.escape(actionName));
                        }
-               } else if (actionName != null) {
+               } else if (action != null) {
                        // Since we can't find an action alias in the 
configuration, we just
                        // assume the action attribute supplied is the path to 
be used as
                        // the URI this form is submitting to.
@@ -171,7 +170,7 @@
               LOG.warn("No configuration found for the specified action: '" + 
actionName + "' in namespace: '" + namespace + "'. Form action defaulting to 
'action' attribute's literal value.");
             }
 
-                       String result = UrlHelper.buildUrl(actionName, 
formComponent.request, formComponent.response, null);
+                       String result = UrlHelper.buildUrl(action, 
formComponent.request, formComponent.response, null);
                        formComponent.addParameter("action", result);
 
                        // namespace: cut out anything between the start and 
the last /


Reply via email to