You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vytautas <tu...@gmail.com> on 2011/03/31 07:53:40 UTC
MetaDataKey in Wicket 1.5
Hi!
Does anybody uses MetaDataKey in wicket 1.5 (Using wicket 1.5-rc2)?
I've created simple quickstart application and added such code into HomePage:
private static final MetaDataKey<String> DATA = new MetaDataKey<String>() {
/**
*
*/
private static final long serialVersionUID = 1L;
};
public HomePage(final PageParameters parameters) {
add(new Label("version", getApplication().getFrameworkSettings().getVersion()));
System.out.println(Session.get().getMetaData(DATA));
Session.get().setMetaData(DATA, String.valueOf(Math.random()));
}
However Session.get().getMetaData(DATA) always returns null. I did not find anything related to this in migration guide.
Any suggestions or usage examples? :)
--
Regards,
Vytautas
-----------------------------------
www.xaloon.org
www.allcarindex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: MetaDataKey in Wicket 1.5
Posted by Vytautas <tu...@gmail.com>.
Thanks, it did help ;)
On 03/31/2011 09:02 AM, Martin Grigorov wrote:
> Session metadata is used by InterceptData
> (RestartResponseAtInterceptPageException), ClientInfo and CryptoMapper, so
> yes, it is used :-)
>
> A wild guess is that HomePage is stateless and thus you always have new
> Session instance.
> Just add Session.get().bind() in HomePage ctor and see.
>
> On Thu, Mar 31, 2011 at 8:53 AM, Vytautas<tu...@gmail.com> wrote:
>
>> Hi!
>> Does anybody uses MetaDataKey in wicket 1.5 (Using wicket 1.5-rc2)?
>>
>> I've created simple quickstart application and added such code into
>> HomePage:
>>
>> private static final MetaDataKey<String> DATA = new MetaDataKey<String>() {
>>
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> };
>> public HomePage(final PageParameters parameters) {
>> add(new Label("version",
>> getApplication().getFrameworkSettings().getVersion()));
>> System.out.println(Session.get().getMetaData(DATA));
>> Session.get().setMetaData(DATA,
>> String.valueOf(Math.random()));
>> }
>>
>> However Session.get().getMetaData(DATA) always returns null. I did not find
>> anything related to this in migration guide.
>> Any suggestions or usage examples? :)
>>
>> --
>> Regards,
>> Vytautas
>> -----------------------------------
>> www.xaloon.org
>> www.allcarindex.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
--
Regards,
Vytautas
-----------------------------------
www.xaloon.org
www.allcarindex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: MetaDataKey in Wicket 1.5
Posted by Martin Grigorov <mg...@apache.org>.
Session metadata is used by InterceptData
(RestartResponseAtInterceptPageException), ClientInfo and CryptoMapper, so
yes, it is used :-)
A wild guess is that HomePage is stateless and thus you always have new
Session instance.
Just add Session.get().bind() in HomePage ctor and see.
On Thu, Mar 31, 2011 at 8:53 AM, Vytautas <tu...@gmail.com> wrote:
> Hi!
> Does anybody uses MetaDataKey in wicket 1.5 (Using wicket 1.5-rc2)?
>
> I've created simple quickstart application and added such code into
> HomePage:
>
> private static final MetaDataKey<String> DATA = new MetaDataKey<String>() {
>
> /**
> *
> */
> private static final long serialVersionUID = 1L;
> };
> public HomePage(final PageParameters parameters) {
> add(new Label("version",
> getApplication().getFrameworkSettings().getVersion()));
> System.out.println(Session.get().getMetaData(DATA));
> Session.get().setMetaData(DATA,
> String.valueOf(Math.random()));
> }
>
> However Session.get().getMetaData(DATA) always returns null. I did not find
> anything related to this in migration guide.
> Any suggestions or usage examples? :)
>
> --
> Regards,
> Vytautas
> -----------------------------------
> www.xaloon.org
> www.allcarindex.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>