Author: rgielen Date: Tue Aug 14 06:40:12 2007 New Revision: 565746 URL: http://svn.apache.org/viewvc?view=rev&rev=565746 Log: WW-2109: id resolution for <s:form> - minor cleanups
Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/Form.java Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/Form.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/Form.java?view=diff&rev=565746&r1=565745&r2=565746 ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/Form.java (original) +++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/Form.java Tue Aug 14 06:40:12 2007 @@ -225,9 +225,10 @@ if (id != null) { addParameter("id", escape(id)); - } else if ( action != null ) { - addParameter("id", escape(action)); } + + // if no id given, it will be tried to generate it from the action attribute in the + // corresponding evaluateExtraParams method if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) { evaluateExtraParamsPortletRequest(namespace, action); } else { @@ -293,8 +294,8 @@ } // if the id isn't specified, use the action name - if (id == null) { - addParameter("id", action); + if (id == null && action!=null) { + addParameter("id", escape(action)); } } else if (action != null) { // Since we can't find an action alias in the configuration, we just assume @@ -373,11 +374,6 @@ * @param action The action to create the URL for. */ private void evaluateExtraParamsPortletRequest(String namespace, String action) { - - if (this.action != null) { - // if it isn't specified, we'll make somethig up - action = findString(this.action); - } String type = "action"; if (TextUtils.stringSet(method)) {