Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001271 [Resin] major always 07-28-06 12:55 08-21-06 15:55
Reporter planetpratt View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.0.21 Product Version 3.0.19
  Product Build
Summary 0001271: PageContext.removeAttribute(name,PageContext.PAGE_SCOPE) removes from ALL scopes
Description The implementation of com.caucho.jsp.PageContextImpl.removeAttribute(String,int) contains the following code:

    switch (scope) {
    case PAGE_SCOPE:
      removeAttribute(name);
      break;

Which improperly calls the PageContext.removeAttribute(String) method.

removeAttribute(String) is specifically defined in the JSP 2.0 spec to "Remove the object reference associated with the given name from all scopes."

Whereas removeAttribute(String,int) is defined to "Remove the object reference associated with the specified name in the given scope".

Since removeAttribute(String,int) calls removeAttribute(String) when it is passed PageContext.PAGE_SCOPE it removes the attribute from ALL scopes, not just the intended scope.
Steps To Reproduce
Additional Information I believe by replacing the call to removeAttribute(name); on line 412 of PageContextImpl.java with:

if(name == null)
  throw new NullPointerException(L.l("removeAttribute must have a non-null name"));
_attributes.remove(name);

resin should once again be JSP 2.0 compliant.

N.B. The Exception message for removeAttribute(String) on line 318 incorrectly identifies itself as getAttribute.
Attached Files

- Relationships

- Notes
(0001474)
ferg
08-21-06 15:55

server/162g
 

- Issue History
Date Modified Username Field Change
07-28-06 12:55 planetpratt New Issue
07-28-06 13:09 planetpratt Issue Monitored: planetpratt
08-21-06 15:55 ferg Note Added: 0001474
08-21-06 15:55 ferg Assigned To  => ferg
08-21-06 15:55 ferg Status new => closed
08-21-06 15:55 ferg Resolution open => fixed
08-21-06 15:55 ferg Fixed in Version  => 3.0.21
08-21-06 16:05 planetpratt Issue End Monitor: planetpratt


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker