You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by bp...@apache.org on 2014/03/18 15:58:14 UTC
[1/2] git commit: https://issues.apache.org/jira/browse/WW-4299 - do
not assign value to id parameter if tryId value is null this prevents
overwriting a parameter with a name of id used with the component tag
Repository: struts
Updated Branches:
refs/heads/develop 3ceb3b973 -> 561063a42
https://issues.apache.org/jira/browse/WW-4299 - do not assign value to id parameter if tryId value is null this prevents overwriting a parameter with a name of id used with the component tag
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cb9f0f56
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cb9f0f56
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cb9f0f56
Branch: refs/heads/develop
Commit: cb9f0f5645d05b2f1c7c66640716acff61c4425f
Parents: 3ceb3b9
Author: phillips1021 <ph...@hotmail.com>
Authored: Tue Mar 18 09:46:36 2014 -0500
Committer: phillips1021 <ph...@hotmail.com>
Committed: Tue Mar 18 09:46:36 2014 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/struts2/components/UIBean.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/cb9f0f56/core/src/main/java/org/apache/struts2/components/UIBean.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/UIBean.java b/core/src/main/java/org/apache/struts2/components/UIBean.java
index 9418a6e..51b7e79 100644
--- a/core/src/main/java/org/apache/struts2/components/UIBean.java
+++ b/core/src/main/java/org/apache/struts2/components/UIBean.java
@@ -1024,8 +1024,13 @@ public abstract class UIBean extends Component {
} else {
tryId = generatedId;
}
- addParameter("id", tryId);
- addParameter("escapedId", escape(tryId));
+
+ //fix for https://issues.apache.org/jira/browse/WW-4299
+ //do not assign value to id if tryId is null
+ if (tryId != null) {
+ addParameter("id", tryId);
+ addParameter("escapedId", escape(tryId));
+ }
}
/**
[2/2] git commit: No JIRA - edit JavaDoc for class to make it clearer
how to assign a value to a parameter when that value is a literal string
Posted by bp...@apache.org.
No JIRA - edit JavaDoc for class to make it clearer how to assign a value to a parameter when that value is a literal string
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/561063a4
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/561063a4
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/561063a4
Branch: refs/heads/develop
Commit: 561063a4227dd609ccba83880b2d0c6ec2d1e4aa
Parents: cb9f0f5
Author: phillips1021 <ph...@hotmail.com>
Authored: Tue Mar 18 09:48:18 2014 -0500
Committer: phillips1021 <ph...@hotmail.com>
Committed: Tue Mar 18 09:48:18 2014 -0500
----------------------------------------------------------------------
.../main/java/org/apache/struts2/components/GenericUIBean.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/561063a4/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/GenericUIBean.java b/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
index 64dfabe..9521e1f 100644
--- a/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
+++ b/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
@@ -56,9 +56,8 @@ import com.opensymphony.xwork2.util.ValueStack;
* engine will be found based on file extension.<p/>
*
* <b>Remember:</b> the value params will always be resolved against the ValueStack so if you mean to pass a
- * string literal to your component, make sure to wrap it in quotes i.e. value="'value1'" otherwise, the the value
- * stack will search for an Object on the stack with a method of getValue1(). (now that i've written this, i'm not
- * entirely sure this is the case. i should verify this manana)<p/>
+ * string literal to your component, make sure to wrap it in single quotes i.e. value="'value1'" (note the opening "' and closing '" otherwise, the the value
+ * stack will search for an Object on the stack with a method of getValue1().<p/>
*
* <!-- END SNIPPET: javadoc -->
*