[
https://issues.apache.org/jira/browse/WICKET-1597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595039#action_12595039
]
Doug Donohoe commented on WICKET-1597:
--------------------------------------
Another bug in appendParamters (twice):
String value = param instanceof String[] ? ((String[])param)[0] : (String)param;
It assumes the values in the PageParameters are Strings, which isn't
necessarily so (the API doesn't dictate this). Ideally this class would use
ValueMap.getString(name), but for some reason only a Map is passed in to the
method (not sure why).
I fixed this locally by copying the getString(name) method locally and using
that.
I ran into this when storing an Integer directly instead of doing
Integer.toString() as well as storying an Enum.
> MixedParamUrlCodingStrategy bugs
> --------------------------------
>
> Key: WICKET-1597
> URL: https://issues.apache.org/jira/browse/WICKET-1597
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.3
> Environment: Firefox
> Reporter: Doug Donohoe
> Priority: Minor
> Fix For: 1.4-M2
>
>
> If a parameter is missing, it is default to "" as seen below.
> if (foundParameter)
> {
> for (int i = 0; i <= lastSpecifiedParameter; i++)
> {
> String parameterName = parameterNames[i];
> final Object param =
> parameters.get(parameterName);
> String value = param instanceof String[] ?
> ((String[])param)[0] : (String)param;
> if (value == null)
> {
> value = ""; // <===== THIS LINE RIGHT
> HERE
> }
> url.append(urlEncode(value)).append("/");
> parameterNamesToAdd.remove(parameterName);
> }
> }
> If the parameter is in the middle, you end up with a URL that looks like:
> foo.com/mypage/param1//param3
> The "//" causes images and CSS to not be found (at least on firefox).
> I fixed this locally by setting the value to "-", and looking for that on the
> way in.
> foo.com/mypage/param1/-/param3
> I'm not sure if this fix would break anything else, so I'm not sure if I
> should submit a patch. One possible issue is if someone is passing '-' as a
> real value and expects it to be there. I could make '-' the default and
> allow someone to change it via API...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.