Hi all,

I just installed a fresh tomcat 4.1.31 and run into this problem. From 4.1.30 to 4.1.31 the PageContexImpl.setAttribute has change in a way that make it unusable. I cannot set null attribute in the pageContext ?!?!?!

So the following call throw an exception in 4.1.31:
pageContext.setAttribute(LOOKUP_GROUP_DATA_KEY + enclosingGroup.getGroup(), null, PageContext.REQUEST_SCOPE);

Is that mean I need to check if an attribute is null before putting it into the pageContext.... It desn`t make sense to me?

This change make 4.1.31 totally unusable for me... Any idea on what I can do? Or where I'm wrong?

Thanks for your help!

/David


4.1.31:
public void setAttribute(String name, Object o, int scope) {
       if (name == null) {
           throw new NullPointerException("name may not be null");
       }

       if (o == null) {
           throw new NullPointerException("object may not be null");
       }

       switch (scope) {
           case PAGE_SCOPE:
               attributes.put(name, o);
               break;

           case REQUEST_SCOPE:
               request.setAttribute(name, o);
               break;

           case SESSION_SCOPE:
               if (session == null)
                   throw new IllegalArgumentException
("can't access SESSION_SCOPE without an HttpSession");
               else
                   session.setAttribute(name, o);
               break;

           case APPLICATION_SCOPE:
               context.setAttribute(name, o);
               break;

           default:
       }
   }




4.1.30
public void setAttribute(String name, Object o, int scope) {
   switch (scope) {
       case PAGE_SCOPE:
       attributes.put(name, o);
       break;

       case REQUEST_SCOPE:
       request.setAttribute(name, o);
       break;

       case SESSION_SCOPE:
       if (session == null)
throw new IllegalArgumentException("can't access SESSION_SCOPE without an HttpSession");
       else
           session.setAttribute(name, o);
       break;

       case APPLICATION_SCOPE:
       context.setAttribute(name, o);
       break;

       default:
   }
   }



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

Reply via email to