id like to initialize my imported Client.class, which communicates with the backend, in my WicketApplication. I know that I have to do this in my WebApplication.class (in the init method right?). But how can I get this instance in my Page.classes? How can I communicate with it?
Thanks for advice
You can get the current Application by using
getApplication()orWebApplication.get(). From there you should be able to narrow its type to your own implementation and call the getter on yourClient.classattribute. Please keep in mind that Application is a shared object between all you users and your Client attribute has to be thread safe if you don’t want nasty things to happen…