Hi,
I have a GWT application that requires a login to gain access. The
ServiceImpl compares the input with records in a mysql database.
A HTTPSession is created if the user exists and when the user requests
information, this session is checked to ensure he is a legitimate user
and it returns a userid.
This userid is then used as parameter in the logAction rpc.
So for every action the user does, a validation RPC takes place and in
the onSuccess method a logAction rpc is implemented.
So to clarify the problem:
RPC.getInstance().isSessionAlive(new AsyncCallback<User>(){
public void onFailure(Throwable caught) {..}
public void onSuccess(User result) {
if(result != null){
RPC.getInstance().logActions(result.getUserId(), (new
Time()).getTime(), "Description", "SomeData", null);
}else{
BodyPanel.getInstance().setMainPanel(new
LoginScreen().getPanel());
}
Becuase my application is pretty large there are going to be a lot of
nested RPC`s because the returned result is needed right away.
Is there another cleaner way to check if someone is logged in and
retrieve the user id without nested RPC`s? (i.e. storing user id local
or some kind of pattern)
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.