You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Johan Compagner <jc...@gmail.com> on 2007/10/17 16:41:44 UTC

Re: StringResourceModel toString() changed in Beta4 - why??? Must use getString() now.

I will change the javadoc.
The toString() method can't return the string, because for that we need a
lot of state internally and that
state isn't there always when toString() is called (especially in debugging)
So we did get exceptions that things wheren't set and so on.

Also toString is just for debugging except in java for a few String and
primitive Object cases.

johan


On 10/17/07, Chris Lintz <ch...@gmail.com> wrote:
>
>
> Hi all,
> I swapped beta3 for beta4 and to my surprise all of my
> StringResourceModels
> that have worked (even back to 1.2) suddenly dont work.  The toString()
> call
> no longer returns the resource String. I dont see this in the release
> notes
> so to say the least, this was a very frustrating find.
>
> For example, this use to work:
>
> public String getPageTitle()
> {
>   return new StringResourceModel("page.title", this, new
> Model(this)).toString();
> }
>
> Now I have to say:
>
> public String getPageTitle()
> {
>    StringResourceModel("page.title", this, new Model(this)).getString();
> }
>
> A subtle change that that took some time to finally track down... Why did
> this change?  I believe the toString() is referenced in many docs.
>
>
> chris
>
> --
> View this message in context:
> http://www.nabble.com/StringResourceModel-toString%28%29-changed-in-Beta4---why-----Must-use-getString%28%29-now.-tf4638851.html#a13249098
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>