Summary: | SetSupport.doEndTag overzealous about cleanup | ||
---|---|---|---|
Product: | Taglibs | Reporter: | Joe Germuska <Joe> |
Component: | Standard Taglib | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.1.0 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other |
Description
Joe Germuska
2005-10-11 00:23:33 UTC
Thanks for starting to investigate. IMO, line 118 of SetSupport.java has a bug, since it calls PageContext/JspContext#removeAttribute(String) instead of PageContext#remove(String,int), causing the "overzealousness" you refer to. You should see this behavior only if the value attribute of c:set evaluates to null. Is that consistent with what you are seeing? However, that's exactly what the JSTL 1.1 Spec. declares to be the correct behavior. See "4.3 <c:set>" under the "Null & Error Handling" subsection. Basically, if the value evaluates to null and no scope has been provided, "...the scoped variable is removed according to the semantics of PageContext.removeAttribute(varName)." So, for this case, the proper usage would be: <c:set var="VENDOR" value="${sessionScope.BROWSE_VENDOR}" scope="page"/> Kris, thanks for the research; I didn't go straight to the spec. Some documentation (like the O'Reilly JavaServer Pages book) describe the "default value" for "scope" as "page" -- I consider that inaccurate based on what you point out in the spec, but that's not a taglibs bug. I think it's incorrect to say that there is a default value for "scope", but rather that there is a well defined process for handling the absence of a "scope" value. Thanks a lot Kris! The line I mention is indeed immaculate with respect to the spec. As a side effect of this conversation, jstl spec public now has issue # 20. |