DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16574>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16574

java.lang.NullPointerException in classes that implement HttpSessionBindingListener

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From [EMAIL PROTECTED]  2004-03-06 15:45 -------
I have reviewed the code and I agree with your analysis of what is causing the 
NullPointerException. I have also reviewed the 2.3 Servlet specification. In 
my view, the specification could be clearer but I believe Tomcat implements 
the specification correctly.

<spec-quote>
SRV.15.1.11.1 Methods
valueBound(HttpSessionBindingEvent)
public void valueBound(HttpSessionBindingEvent event)
Notifies the object that it is being bound to a session and identifies the 
session.
Parameters:
event - the event that identifies the session
</spec-quote>

It is clear that the event must identify the session. It makes no mention of 
the value. To me this seems sensible as the object already knows it's own 
value. For example, your code could be re-written as:

public void valueUnbound(HttpSessionBindingEvent be) {
  System.out.println("The user " + getName() + " was unbounded");
}

which would not generate a NullPointerException.

When notifing registered application event listeners, Tomcat does include the 
object.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to