Menu

Welcome to Help

Help
2007-08-04
2013-04-16
  • Nobody/Anonymous

    Welcome to Help

     
    • Addy Kapur

      Addy Kapur - 2007-09-02

      Please feel free to post your questions or issues regarding GWTiger here.

       
    • mahamad

      mahamad - 2007-09-18

      Dear Addy

      I have started having a look at gwtiger and some of the functionality in it looks great.  I am particularly interested in how the session handling works.  However, after checking the code and running the online demo, I noticed that the session information on the user (i.e. username) which should be displayed with the Welcome message is not displayed.  Have I genuinely missed something or is this a potential bug?

      Thanks in advance

      Kind Regards

      Mahamad

       
    • mahamad

      mahamad - 2007-09-19

      Hi Addy

      Thanks for getting back to me so soon.  I have had a look at the classes and I'll have another play around with them to see if I'm making a mistake somewhere.

      In the meantime, can I ask how I should be checking who is logged in and retrieving the User Object?  Should I be:
      1. Just retrieving the name from the cookie (this doesn't sound viable as it's only for the remember me function - if someone doesn't select it, then I won't know who's logged in).

      2. Pass the user object from one GWT BaseScreen to another?  I think this is already in the setMainScreen(User) method, should we just use this.

      3. Have it stored in the singleton and then be able to access it from throughout the project

      4. Utilise the getUserFromSession() or isSessionAlive() method in the Service Implementation? (Doesn't this lead to a large number of RPC calls?

      When running the GWTigerDemo code, the user object seems to be initialised, then when I try to access it from the TopPanel to show the User Information, no user can be found for some reason and therefore nothing is displayed with the Welcome! screen.  I think even with just the GWT Hosted Mode Application, this should work right?

      Thank you for helping me out here, I'm still a bit of a newbie with GWT and any help is appreciated.  (GWTiger is going to make my life a lot easier with session handling... thanks!)

      Moe

       
      • Addy Kapur

        Addy Kapur - 2007-09-20

        There are different ways of doing this and it all depends on what you want to do.

        What I have done in an application is to use the Base class (e.g. BaseMyAppScreen) from which all screens are derived.
        If you set this user from your Login screen, it will be available from all your screens. The singleton method will achieve the same result but this code is smaller.

        private static UserBean user=null;

        public void setUser(UserBean u) {
                user=u;
            }
            public UserBean getUser()   {
                return user;
            }

        Let me know if this works for you. I will add it to my example application.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.