struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre-Yves Soblet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4628) Space character and includeParams
Date Wed, 04 May 2016 17:49:12 GMT

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

Pierre-Yves Soblet commented on WW-4628:
----------------------------------------

Hi victorsosa,

I would expect both URLs of my example to be the same.

Suppose I have a site with two search actions searchSimple and searchExtended that both take
a single parameter searchCriteria. In the first search page, a link is built referring to
the second search page using <s:a> or <s:url> tag with includeParams to propagate
the searchCriteria value (present in the URL) from one page to the other. 
If in my first search page, the searchCriteria value contains a space (as entered by the user
in a search form), going to the second search page via the link will change the value (the
space in the first search form becomes a plus in the second search form). It is apparent once
you put an input field displaying the value.


> 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
>             Fix For: 2.3.x
>
>         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)

Mime
View raw message