[Webwork-devel] Question about Session & ApplicationMap
Brought to you by:
baldree,
rickardoberg
From: Nils H. <nil...@te...> - 2001-11-15 13:35:26
|
Hi, I have a problem with the implementation of SessionMap and ApplicationMap. Both classes implement the entrySet()-method to return a HashSet of the elements in the wrapped objects (HttpSession, resp. ServletContext's attributes + ServletContext's init params). But this HashSet is only build once, the first time entrySet() is called. This works fine if the map(s) are not modified after calling entrySet() the first time. If the map(s) are modified, they still return the old values. While the new values are correctly set on the wrapped objects, they are not returned using the entrySet() method the next time(s). Unfortunatly the entrySet() method is used a lot of times in the super class java.util.AbstractMap, so that the map's behaviour then is uncorrect. One way to solve this problem could be setting the attribute ApplicationMap.entries resp. SessionMap.entries back to null in the put(Object, Object), remove(Object) and clear() methods. Or am I completly wrong? Regards, Nils -- Nils Hartmann Fruchtallee 132 D-20259 Hamburg Tel: +49-40-525 604 90 |