Craig:

What's wrong with changing the offending lines to:

pageContext.getRequest().removeAttribute(Constants.BEAN_KEY);
pageContext.getRequest().removeAttribute(Constants.FORM_KEY);

from:

pageContext.removeAttribute(Constants.BEAN_KEY,
PageContext.REQUEST_SCOPE);
pageContext.removeAttribute(Constants.FORM_KEY,
PageContext.REQUEST_SCOPE);

Does this not remove the attributes correctly?

Thanks for all you work.
David Janovy

-----Original Message-----
From: Craig R. McClanahan 
.....
NOTE:  The commonly proposed workaround for this (delete the two
removeAttribute lines from FormTag.doEndTag()) has a negative
consequence,
which is the reason that I haven't changed the Struts code itself.  The
problem is that the scope of the scripting variable corresponding to
your
form bean is defined as NESTED -- in other words, it is visible only
within the body of the <html:form>.

The removal of the request attributes is to make those attributes have
the
same scope -- otherwise, the request attributes remain defined for the
remainder of the page.  This can lead to programming errors if you
depend
on it, because with this patch things like <bean:write> will still be
able
to see the form bean after the </html:form> tag, when they should not be
able to.

Therefore, I'm not planning on changing this code in Struts 1.0 final.

Craig

Reply via email to