There are examples when various types of objects are introduced into the presenter, but I cannot find an explanation of how this can be done.
In the Bootstrap-Code example, they enter, for example. a SecurityDelegate .
Also in the Gatekeeper example, I see things being introduced, for example. MyGatekeeper , but how to do it?
I want to first check if the user is registered, and then create a CurrentSession object or something like this. But how can I pass / paste this object around?
I'm currently initializing a singleton object, CurrentUser , which is kind of ugly imho. I would like to get GWTP support, but how?
Take this CurrentSession example, which is entered into the gatekeeper:
@DefaultGatekeeper public class LoggedInGatekeeper implements Gatekeeper { private final CurrentSession currentSession; @Inject LoggedInGatekeeper(CurrentSession currentSession) { this.currentSession = currentSession; } @Override public boolean canReveal() { return currentSession.isLoggedIn(); } }
How do I insert CurrentSession here?
source share