error(new ResourceModel(“my.key”));
It might fail:
Component#error()
-> #addStateChange()
-> Page#componentStateChanging()
-> #dirty()
-> #getSession()
-> ThreadContext#getSession()
You're not allowed to do anything with a Wicket component from a non-request
thread. Period.
Sven
On 09/18/2013 03:57 PM, Rafael W. wrote:
2013/9/18 Sven Meier <[email protected]>
error(new ResourceModel(“my.key”).**getObject());
error(new ResourceModel(“my.key”));
Both might/will fail if called from a non-request thread, because there is
no Application attached.
error(new ResourceModel(“my.key”)); does not fail when called from a
non-request thread. The constructor of ResourceModel only sets two
properties.
error(new ResourceModel(“my.key”).getObject()); does however fail since it
internally calls Application.get() in order to receive the localized
resource strings which are application specific.