Tuesday, May 31, 2016

Re: Getting username from url only works after refresh

As said what you have done is generally fine in terms of passing data to a new place. I am saying that you have a bug somewhere in your code that results in a blank "logged in as: " widget because when you do placeController.goTo(new UserPlace(username)) then your UserActivity should be created with the same UserPlace instance as constructor parameter and thus you have the username available in your UserActivity. If that does not happen something is generally wrong in your code.

Personally I would not store the username in the browser URL as it is data for the current user session. An URL can be shared with other people so it should not contain "personal" information, only navigational information. At work we have a class called UserSession which stores user related data like username, permissions and is used as a singleton.

-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment