You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Frank Silbermann <fr...@fedex.com> on 2008/06/19 21:29:38 UTC
Change to PageParameters?
In my Wicket 1.2 application I used PageParameters like a simple
HashMap, calling:
pageParameters.put(keyString, valueString)
and
String s = (String) pageParameters.get(keyString)
After upgrading to Wicket 1.3 the GET is causing a ClassCastException:
[Ljava.lang.String; cannot be cast to java.lang.String
I didn't read anything about PageParameters in
http://cwiki.apache.org/WICKET/migrate-13.html
What change should I make to my code? Would I simply replace "(String)
pp.get(x)" with "pp.getString(x)"?
Re: Change to PageParameters?
Posted by Igor Vaynberg <ig...@gmail.com>.
in 1.3 pageparameters properly support string[] arrays like httpservletrequest.
you should use pageparameters.getstring(keystring);
-igor
On Thu, Jun 19, 2008 at 12:29 PM, Frank Silbermann
<fr...@fedex.com> wrote:
> In my Wicket 1.2 application I used PageParameters like a simple
> HashMap, calling:
>
> pageParameters.put(keyString, valueString)
>
> and
>
> String s = (String) pageParameters.get(keyString)
>
> After upgrading to Wicket 1.3 the GET is causing a ClassCastException:
> [Ljava.lang.String; cannot be cast to java.lang.String
>
> I didn't read anything about PageParameters in
> http://cwiki.apache.org/WICKET/migrate-13.html
>
> What change should I make to my code? Would I simply replace "(String)
> pp.get(x)" with "pp.getString(x)"?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Change to PageParameters?
Posted by Brill Pappin <br...@pappin.ca>.
not sure about what the javadocs say, but that exception says your
casting a string array to a string.
What your doing is:
String[] x = {"value1","value2"};
String y = (String)x;
- Brill Pappin
On 19-Jun-08, at 3:29 PM, Frank Silbermann wrote:
> In my Wicket 1.2 application I used PageParameters like a simple
> HashMap, calling:
>
> pageParameters.put(keyString, valueString)
>
> and
>
> String s = (String) pageParameters.get(keyString)
>
> After upgrading to Wicket 1.3 the GET is causing a ClassCastException:
> [Ljava.lang.String; cannot be cast to java.lang.String
>
> I didn't read anything about PageParameters in
> http://cwiki.apache.org/WICKET/migrate-13.html
>
> What change should I make to my code? Would I simply replace
> "(String)
> pp.get(x)" with "pp.getString(x)"?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org