tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: PageContext.removeAttribute
Date Mon, 20 Nov 2000 21:15:23 GMT
Pierre Delisle wrote:
> 
> > Bug report #412 has just been filed.
> 
> > Synopsis:
> > public void removeAttribute(String name) does not work properly
> >
> > Description:
> > lt. spec from sun this method is required to remove
> > the attribute from every scope.  in class PageContextImpl
> > however this only removes attributes from the page context:
> >
> > public void removeAttribute(String name) {
> >   attributes.remove(name);
> > }
> >
> 
> This is indeed a bug, and I can go ahead and fix it
> (at least in 3.3/4.0).
> However, before I do so, would someone know why we
> have the following comments/code in PageContextImpl?
> 
> In the class comments:
>  * The removeAttribute method does not work for request scope. Needs fixing.
> 
> public void removeAttribute(String name, int scope) {
>     switch (scope) {
>     ...
>     case REQUEST_SCOPE:
>         throw new IllegalArgumentException("cant remove Attributes from request scope");
>     ...

Most likely these are pre-Servlet 2.2 comments. Prior to Servlet 2.2 there
was no way to remove a request attribute.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Mime
View raw message