This content has been marked as final. Show 4 replies
I see you mention OCCAS in your thread.
But here is what javadoc says for sip servlets
void setAttribute(java.lang.String name,
Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.
name - the name to which the object is bound; cannot be null
attribute - the object to be bound; cannot be null
java.lang.IllegalStateException - if this method is called on an invalidated session
java.lang.NullPointerException - on null name or attribute.
So both name and value cannot be null
That was unexpected!
My problem is not related to SipSessions but the SipServletRequest.setAttribute has the same text.
OCCAS is doing the right thing! But this has to be a bug in JSR-289 since the base interface from Servlet API 2.3 (which is referred by JSR-289) says that ServletRequest.setAttribute should accept null value and act as removeAttribute. The SipServletRequest is not honoring the contract defined by the interface it extends.
But in the end OCCAS is doing the right thing according to JSR-289 and I have to spend a long night doing null checks. :-)