pierred 00/11/20 16:18:27
Modified: src/share/org/apache/jasper/runtime Tag: tomcat_32
PageContextImpl.java
Log:
Fix for bug report #412:
public void removeAttribute(String name) does not work properly
- removeAttribute now removes the attribute from the 4 scopes.
- REQUEST_SCOPE now handled properly.
Revision Changes Path
No revision
No revision
1.13.2.3 +13 -7
jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java
Index: PageContextImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -r1.13.2.2 -r1.13.2.3
--- PageContextImpl.java 2000/11/10 23:19:25 1.13.2.2
+++ PageContextImpl.java 2000/11/21 00:18:25 1.13.2.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
1.13.2.2 2000/11/10 23:19:25 craigmcc Exp $
- * $Revision: 1.13.2.2 $
- * $Date: 2000/11/10 23:19:25 $
+ * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
1.13.2.3 2000/11/21 00:18:25 pierred Exp $
+ * $Revision: 1.13.2.3 $
+ * $Date: 2000/11/21 00:18:25 $
*
* ====================================================================
*
@@ -92,8 +92,6 @@
/**
* Implementation of the PageContext class from the JSP spec.
*
- * The removeAttribute method does not work for request scope. Needs fixing.
- *
* @author Anil K. Vijendran
* @author Larry Cable
* @author Hans Bergsten
@@ -286,7 +284,7 @@
break;
case REQUEST_SCOPE:
- throw new IllegalArgumentException("cant remove Attributes from
request scope");
+ request.removeAttribute(name);
case SESSION_SCOPE:
if (session == null)
@@ -367,7 +365,15 @@
}
public void removeAttribute(String name) {
- attributes.remove(name);
+ try {
+ removeAttribute(name, PAGE_SCOPE);
+ removeAttribute(name, REQUEST_SCOPE);
+ removeAttribute(name, SESSION_SCOPE);
+ removeAttribute(name, APPLICATION_SCOPE);
+ } catch (Exception ex) {
+ // we remove as much as we can, and
+ // simply ignore possible exceptions
+ }
}
public JspWriter getOut() {