Hello, I found a little problem in StandardSesssion.java. I hope this is the correct place to send it to.
Acording to section SVR.7.4 of the servlet spec: "The valueBound method must be called before the object is made available via the getAttribute method of the HttpSession interface. The valueUbound method must be called after the object is no longer available via the getAttribute method of the HttpSession interface.". The problem in the setAttribute() code is that valueBound() is called after the value is put into the attributes of the session. Here is the code with the problem: .... // Replace or add this attribute Object unbound = null; synchronized (attributes) { unbound = attributes.get(name); attributes.put(name, value); } // Call the valueUnbound() method if necessary if ((unbound != null) && (unbound instanceof HttpSessionBindingListener)) { ((HttpSessionBindingListener) unbound).valueUnbound (new HttpSessionBindingEvent((HttpSession) this, name)); } // Call the valueBound() method if necessary HttpSessionBindingEvent event = null; if (unbound != null) event = new HttpSessionBindingEvent ((HttpSession) this, name, unbound); else event = new HttpSessionBindingEvent ((HttpSession) this, name, value); if (value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener) value).valueBound(event); ... Here is the corrected code: .... // Construct an event with the new value HttpSessionBindingEvent event = new HttpSessionBindingEvent ((HttpSession) this, name, value); // Call the valueBound() method if necessary if (value instanceof HttpSessionBindingListener) ((HttpSessionBindingListener) value).valueBound(event); // Replace or add this attribute Object unbound = null; synchronized (attributes) { unbound = attributes.get(name); attributes.put(name, value); } // Call the valueUnbound() method if necessary if ((unbound != null) && (unbound instanceof HttpSessionBindingListener)) { ((HttpSessionBindingListener) unbound).valueUnbound (new HttpSessionBindingEvent((HttpSession) this, name)); } // Replace the current event with one containing the old value if necesary if (unbound != null) event = new HttpSessionBindingEvent ((HttpSession) this, name, unbound); ... regards, Pablo Morales Condumex Inc. 1184E Corporate Dr. West Arlington, Texas, 76006 Tel. (817) 607-18-13,(817) 607-15-00 ext 1813 Fax. (817) 607-18-33