I following the mailing list at
http://markmail.org/message/t5sopnse2wgqms7u#query:accessing%20requestglobals%20inside%20dispatcher%20and%20other%20data%20support%20classes+page:1+mid:ks77ayww62mra7in+state:results,
trying to obtain data from RequestGlobals.
So in my e.g. Login.java contains
Object onSubmitFromLogin(){
...
requestGlobals.getRequest().setAttribute(
"user",
new User(getAccount(), "", getPassword())
);
...
}
and in AccessController.java it has
public AccessController(ApplicationStateManager asm, RequestGlobals
globals){
this.asm = asm;
this.globals = globals;
}
public boolean dispatch(Request request, Response response) throws
IOException{
if(asm.exists(UserPermissions.class)){
UserPermissions permission =
asm.get(UserPermissions.class);
User user =
(User)requestGlobals.getRequest().getAttribute(USER);
...
}
}
However, it seems like the RequestGlobals inside Login.java and
AccessController.java are two different instances because in Login.java I can
see the User object after using getAttribute(). In contrast, I can obtain User
object inside dispatch() function in AccessController.java.
Where did I do it wrong? Or what is the right way to obtain data from Request
or RequestGlobals?
Thank you very much.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]