You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (Commented) (JIRA)" <ji...@apache.org> on 2011/10/17 21:23:10 UTC

[jira] [Commented] (TAP5-1449) Percent (%) symbol in query parameter is not being encoded

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

Howard M. Lewis Ship commented on TAP5-1449:
--------------------------------------------

Would using link.addParameterValue() fix this?  It runs the value through ContextPathEncoder service.

Tapestry: hard things are automatic, but (occasionally) easy things are hard.
                
> Percent (%) symbol in query parameter is not being encoded 
> -----------------------------------------------------------
>
>                 Key: TAP5-1449
>                 URL: https://issues.apache.org/jira/browse/TAP5-1449
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Geoff Callender
>            Assignee: Howard M. Lewis Ship
>
> Eg. In an event handler method I create a Link, add a query parameter to it called "thing" with value "%ab", then return the link. The resulting URL is something like this:
>     http://localhost/myapp/mypage?thing=%ab
> but it should be:
>     http://localhost/myapp/mypage?thing=%25ab
> In mypage, when we do this:
>     value = request.getParameter("thing");
> the value is null from the first URL, which is bad, and "%ab" from the second URL, which is good.
> So Tapestry is correctly decoding "%25" to "%", but it is not encoding "%" to "%25".
> For now, the workaround is to do this when adding the query parameter:
>     link.addParameter("thing", value.replaceAll("%", "%25"));

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira