[
http://jira.jboss.com/jira/browse/JBSEAM-791?page=all ]
Gavin King closed JBSEAM-791.
-----------------------------
Fix Version/s: 1.1.6.GA
Resolution: Done
Assignee: Gavin King
Thanks, applied your patch.
Restful paramameter values are not URL encoded
----------------------------------------------
Key: JBSEAM-791
URL:
http://jira.jboss.com/jira/browse/JBSEAM-791
Project: JBoss Seam
Issue Type: Bug
Environment: Latest seam from CVS
Reporter: John Ray
Assigned To: Gavin King
Fix For: 1.1.6.GA
I have an application that using restful URLs like the blog example. The problem is that
the parameter values are not URL encoded. So if a user does a search for
"books+records" then the url ends up being
/search.seam?searchPattern=books+records
After the redirect the plus ends up being decoded to a space and you end up searching for
"books records". The correct URL should be
/search.seam?searchPattern=books%2Brecords
The problem is in org.jboss.seam.core.Manager.encodeParameters()
Line 902 - builder.append(value);
Needs to be changed to something like
try {
builder.append(URLEncoder.encode(String.valueOf(value),"UTF-8"));
}
catch (UnsupportedEncodingException e)
{
// This should never happen because we hard coded the encoding to
UTF-8
throw new RuntimeException(e);
}
Line 913 - builder.append(parameterValue);
Needs to be changed to something like
try {
builder.append(URLEncoder.encode(String.valueOf(parameterValue),"UTF-8"));
}
catch (UnsupportedEncodingException e)
{
// This should never happen because we hard coded the encoding to
UTF-8
throw new RuntimeException(e);
}
If I make the above 2 changes then everything works fine for me.
It also seems that the encodeConversationId() method would have a similar problem if an
explicit conversation id was used that has characters that should be URL encoded.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira