Hi,
I know this is not the right place for GWT questions, sorry i have to put it here coz i don't know anywhere else that i can get help.
I m doing some Session stuff using Ext GWT, but i even couldn't get a simple thing working. I m trying to get a HashMap from the Session, and save some values to the Map, and retrieve the values later on. What i did is creating RPC, on the server side, the implementation class, i write:
Code:
...
public HashMap getSessionMap(String key) {
if (session.getAttribute(key) == null) {
session.setAttribute(key, new HashMap());
}
// Return the HashMap
return (HashMap) session.getAttribute(key);
}
public HttpSession getSession() {
return this.getThreadLocalRequest().getSession();
}
...
on the client side, i call this service, get the map, and put values in the map.
But it seems that i get a new map each time i call the service, and there's always only one value in the map. After debugging, i found it's wierd that the HashMap gets created only once(the first time the session attribute is checked), but the map is always empty. I m very confused, the session seems have had the map, but the map can not save any values.
Anyone can help me? please give me some advise about how the Session in GWT should be used, can i save a JavaBean object to the Session?
Any help will be appreciated! Thank you very much!!
Best Regards