Matt Krevs wrote:

> Anyone know how to modify or remove the value of an attribute that has been
> set by calling request.setAttribute( attributeName, value )?
>
> Calling request.setAttribute(attributeName, value) with a different value
> causes an IllegalStateException.
>
> Calling request.setAttribute(attributeName, null) causes a
> NullPointerException.
>
> HttpSession has a removeValue() method, ServletContext has a
> removeAttribute() method yet ServletRequest doesnt seem to have a similar
> method.
>
> Am I missing something or is there a hole in the servlet API?
>

The ServletRequest.removeAttribute() method was added to the servlet version 2.2
API (and the IllegalStateException for replacing an existing attribute is not
documented) -- however, all request attributes are automatically removed after a
request is finished.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to