Hi everybody,
I have a question with SmartGWT , how can i store session variables, like username, role and relevant data to use in the application flow.
I had thought to use a client class with a static HashMap with key and value, for example:
private static HashMap<String, Object> sessiondata = new HashMap<String, Object>();
In the login window put:
sessiondata .put("username","example");
And in another part of the application flow, retrieve the value like this...
sessiondata .get("username");
But, it has a problem because, if there are 2 concurrent users or more, this value will be overwritten because the map is static. any idea ?
Thanks for your help ...
I have a question with SmartGWT , how can i store session variables, like username, role and relevant data to use in the application flow.
I had thought to use a client class with a static HashMap with key and value, for example:
private static HashMap<String, Object> sessiondata = new HashMap<String, Object>();
In the login window put:
sessiondata .put("username","example");
And in another part of the application flow, retrieve the value like this...
sessiondata .get("username");
But, it has a problem because, if there are 2 concurrent users or more, this value will be overwritten because the map is static. any idea ?
Thanks for your help ...
Comment