[ 
https://issues.apache.org/struts/browse/WW-2993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46008#action_46008
 ] 

Wes Wannemacher commented on WW-2993:
-------------------------------------

no, that makes it difficult for us to absorb the change. The easiest way I've 
found to make a patch is to checkout the source code like so -

svn co https://svn.apache.org/repos/asf/struts/current/ struts

(note - this will take a while since it will download the entire struts 
distribution [struts 1 and struts 2])

Then, drill down into the files you want to change, eg. -

cd struts2/core/src/main/java/org/apache/struts2/wherever

make your changes - 

vim DoubleListUIBean.java

*rebuild the framework (using maven if you're familiar with it) 

cd ../../../../../../ (however far it takes to go into the core folder again)
mvn clean install

and watch to see if any unit tests fail and correct any problems
then, run svn diff to see what changes have been made 

svn diff . (do this from a source directory anywhere in the tree)

this will output the patch file, so you can redirect it somewhere to get an 
uploadable file

svn diff . > /tmp/ww-2993.patch

then, attach that file to this JIRA issue, but make sure that you mark the 
checkmark that gives us permission to use it for ASF purposes.

To summarize - 

svn co https://svn.apache.org/repos/asf/struts/current/ struts
cd struts/struts2/core/src/main/java/org/apache/struts2/components/
vim DoubleListUIBean.java
svn diff . > /tmp/ww-2993.patch

and upload it here. It seems like a lot of work, but if you're using an IDE, 
most of this can be automated, just tell Eclipse/IDEA to pull a maven project 
down from the repository 
(https://svn.apache.org/repos/asf/struts/struts2/core/trunk) and make the 
changes in your IDE, then tell the IDE to create a patch file. It's easier this 
way, but sometimes launching, configuring the IDE and importing a project can 
take longer than just doing it on the command line, either way, dealing with 
patches helps us track the contributions and tie them to the contributor (you 
in this case) for proper attribution.

> double Name expression gets escaped without being evaluated
> -----------------------------------------------------------
>
>                 Key: WW-2993
>                 URL: https://issues.apache.org/struts/browse/WW-2993
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.14
>            Reporter: Qiang Zheng
>             Fix For: 2.1.7
>
>
> In DoubleListUIBean.java, there is one piece of code trying to populate 
> "doubleId" parameter. Looks like when "form!=null" this.doubleName get 
> escaped without being evaluated. The counter part in "form is null" case does 
> "findString" before do "escape". This cause problem when we pass in 
> doubleName as
> "%{#attr.name}", the lower part of "doubleId" became "_%{#attr_name}". Here 
> is the code.
> -----------------------------------------------------------------
> if (doubleId != null) {
> .....           
>         } else if (form != null) {
>             addParameter("doubleId", form.getParameters().get("id") + "_" 
> +escape(this.doubleName));
>         } else {
>             addParameter("doubleId", escape(doubleName !=null ? 
> findString(doubleName) : null));
>         }
> -----------------------------------------------------------------
> Should it acutally be:
> if (doubleId != null) {
> .....           
>         } else if (form != null) {
>             addParameter("doubleId", form.getParameters().get("id") + "_" 
> +escape(doubleName !=null ? findString(doubleName) : null));
>         } else {
>             addParameter("doubleId", escape(doubleName !=null ? 
> findString(doubleName) : null));
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to