This code runs on the server and not on the client.
so make sure that you add this methof into your ServiiceImpl code:
public UserVo isUserLoggedIn() throws IllegalArgumentException {
// TODO Auto-generated method stub
HttpSession session = this.getThreadLocalRequest().getSession();
if(session != null){
if(session.getAttribute("user")!=null){
UserDesktopVo response = new UserDesktopVo();
UserVo user = (UserVo)session.getAttribute("user");
response.setUser(user);
response.setDesktop(generateUserDesktop(user.getId()+""));
return user;;
}else {
return null;
}
}else {
return null;
}
}

Just call this method from client code and if the return type is not null
then just grab the UserVo and use it inside your client code to set the User
preferences widgets otherwise you will need to show the login screen.
UserVo is a simple POJO class which containts String firstname, lastname,...
and all other properties needed for the user.

regards,
Rudolf Michael

On Tue, Jul 20, 2010 at 7:54 AM, Krati Agarwal <[email protected]> wrote:

> sir,
>
> um working on a project and actually needs to maintain a user session
> when he logs in.
> i am not getting the proper commands to use sessions in gwt.
> can u please tell  me the proper steps and commands of how to use
> sessions in gwt and how i can maintain a user login for it.
> i will be thankful to you.
> krati
>
> --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
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.

Reply via email to