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

Christoph Nenning edited comment on WW-4628 at 9/23/16 9:23 AM:
----------------------------------------------------------------

{quote}
Now when I want to define two params in <s:url/> tag, the & is replaced with & 
amp; which is invalid :/
{quote}

As far as I can tell that behavior exists since some years. It is caused by 
setting {{setEscapeAmp()}} to {{true}} by default in 
{{org.apache.struts2.components.URL}}.

I double checked with one of my apps which uses 2.3.28.1. Obviously browsers 
are ignoring that error in URLs. When looking at them in browser debug tools 
they are shown correctly but when using "view source" in browser it shows 
{{&amp;}} instead of {{&}}.


was (Author: cn42):
{quote}
Now when I want to define two params in <s:url/> tag, the & is replaced with & 
amp; which is invalid :/
{quote}

As far as I can tell that behavior exists since some years. It is caused by 
setting {{monospaced}}setEscapeAmp(){{monospaced}} to 
{{monospaced}}true{{monospaced}} by default in 
{{monospaced}}org.apache.struts2.components.URL{{monospaced}}.

I double checked with one of my apps which uses 2.3.28.1. Obviously browsers 
are ignoring that error in URLs. When looking at them in browser debug tools 
they are shown correctly but when using "view source" in browser it shows 
{{monospaced}}&amp;{{monospaced}} instead of {{monospaced}}&{{monospaced}}

> Space character and includeParams
> ---------------------------------
>
>                 Key: WW-4628
>                 URL: https://issues.apache.org/jira/browse/WW-4628
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.28
>            Reporter: Pierre-Yves Soblet
>            Assignee: Christoph Nenning
>             Fix For: 2.3.31, 2.5.3
>
>         Attachments: Struts2UrlTest.zip
>
>
> With this JSP snippet using Struts 2 taglib:
> {code}
> myParameter=[<s:property value="%{#parameters['myParameter']}"/>]
> <br/>
> <s:url action="url" includeParams="get"/>
> <br/>
> <s:url action="url">
>     <s:param name="myParameter" value="%{#parameters['myParameter']}"/>
> </s:url>
> {code}
> When the action is called with a parameter containing a space (which is 
> escaped in the URL) :
> {code}
> localhost:8080/url?myParameter=with+space
> {code}
> The output is as follows :
> {code}
> myParameter=[with space]
> /url.action?myParameter=with%2Bspace
> /url.action?myParameter=with+space    
> {code}
> The *includeParams* attribute of the “url” tag seems to transform the "space" 
> character into the "plus" character (both in their url-encoded forms).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to