From 4717110ea214df8773fd239440b2de6eaa972e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Gielen?= Date: Tue, 14 Aug 2007 13:40:12 +0000 Subject: [PATCH] WW-2109: id resolution for - minor cleanups git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565746 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/struts2/components/Form.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/components/Form.java b/core/src/main/java/org/apache/struts2/components/Form.java index 6bc024ed5..948eed744 100644 --- a/core/src/main/java/org/apache/struts2/components/Form.java +++ b/core/src/main/java/org/apache/struts2/components/Form.java @@ -225,9 +225,10 @@ public class Form extends ClosingUIBean { 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 @@ public class Form extends ClosingUIBean { } // 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 @@ -374,11 +375,6 @@ public class Form extends ClosingUIBean { */ 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)) { if ("GET".equalsIgnoreCase(method.trim())) {