Issue Details (XML | Word | Printable)

Key: WICKET-358
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jean-Baptiste Quenot
Reporter: Jean-Baptiste Quenot
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Wicket

Properly decode URLs

Created: 05/Mar/07 12:30 PM   Updated: 10/Jun/07 04:32 PM
Return to search "STDCXX Sun C++ issues"
Component/s: wicket
Affects Version/s: None
Fix Version/s: 1.3.0-beta1, 2.0 branch (discontinued)

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 20070305-wicket-1.x-decode-request-parameters.txt 2007-03-05 01:00 PM Jean-Baptiste Quenot 15 kB
Text File Licensed for inclusion in ASF works 20070305-wicket-1.x-decode-request-parameters.txt 2007-03-05 12:46 PM Jean-Baptiste Quenot 15 kB
Text File Licensed for inclusion in ASF works 20070305-wicket-1.x-decode-request-parameters.txt 2007-03-05 12:33 PM Jean-Baptiste Quenot 13 kB

Resolution Date: 06/Mar/07 10:01 AM


 Description  « Hide
There are places where Wicket decodes an URL and builds a Map of parameters:
* Form.FormDispatchRequest(Request, String)
* WebRequestWithCryptedUrl(HttpServletRequest) (deprecated class)
* MockHttpServletRequest
* AutoLinkResolver
* PageParameters(String, String)
* CryptedUrlWebRequestCodingStrategy

Sometimes, String arrays are not properly handled. Sometimes the parameters are not URL-decoded. Sometimes the empty values are not properly handled. The idea is to remove duplicate code and provide a centralized piece of code to decode an URL.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jean-Baptiste Quenot added a comment - 05/Mar/07 12:46 PM
Also change CryptedUrlWebRequestCodingStrategy, and deprecate PageParameters(String, String) which is meant to be used for decoding URL parameters.

Jean-Baptiste Quenot added a comment - 05/Mar/07 01:00 PM
Handle empty values correctly

Johan Compagner added a comment - 06/Mar/07 07:18 AM
what about BookmarkablePageRequestTargetUrlCodingStrategy.appendParameters(AppendingStringBuffer url, Map parameters)
where we call String escapedValue = urlEncode(entry.getValue().toString()); (also done in QueryStringUrlCodingStrategy)

Jean-Baptiste Quenot added a comment - 06/Mar/07 08:34 AM
Johan: this issue is only about decoding an URL into a ValueMap. But thanks for pointing me to BookmarkablePageRequestTargetUrlCodingStrategy, actually there is yet another decoding method in AbstractRequestTargetUrlCodingStrategy.decodeParameters(String, Map) that uses slashes instead of ampersand and equal signs. However it seems to properly handle URL decoding and String arrays, and because of the slashes it is too specific to merge it with another existing method.

Jean-Baptiste Quenot added a comment - 06/Mar/07 09:21 AM
Done in 1.x, need to port to trunk