P
plmuon
Hello,
I found something strange in most struts tags (using struts 1.2.4);
maybe my understanding of the JSP spec is wrong, but if not than there
would be an error in many struts tags:
Most struts tags such as html:errors (ErrorsTag) use the Tag.release()
method to reset the attributes to their default state.
However, the description of Tag.release() says:
Called on a Tag handler to release state. The page compiler guarantees
that JSP page implementation objects will invoke this method on all tag
handlers, but there may be multiple invocations on doStartTag and
doEndTag in between.
So, in my understanding, one should reset attributes to their default
state not using the release() method, but by doing so explicitly at the
end of doEndTag so the tag instance is prepared for its next use (in
case it is pooled by the JSP container).
This is confirmed by the following quote from Resing,
http://www.caucho.com/resin-3.0/jsp/tutorial/taglib-reuse/index.xtp:
Resin does not call release() between the first and third <msg:message>
tags. It only calls release() at the end of the page. This behavior
follows the JSP spec, but surprises some tag library developers.
What do you think, do struts tags indeed misunderstand the JSP spec
here?
I found something strange in most struts tags (using struts 1.2.4);
maybe my understanding of the JSP spec is wrong, but if not than there
would be an error in many struts tags:
Most struts tags such as html:errors (ErrorsTag) use the Tag.release()
method to reset the attributes to their default state.
However, the description of Tag.release() says:
Called on a Tag handler to release state. The page compiler guarantees
that JSP page implementation objects will invoke this method on all tag
handlers, but there may be multiple invocations on doStartTag and
doEndTag in between.
So, in my understanding, one should reset attributes to their default
state not using the release() method, but by doing so explicitly at the
end of doEndTag so the tag instance is prepared for its next use (in
case it is pooled by the JSP container).
This is confirmed by the following quote from Resing,
http://www.caucho.com/resin-3.0/jsp/tutorial/taglib-reuse/index.xtp:
Resin does not call release() between the first and third <msg:message>
tags. It only calls release() at the end of the page. This behavior
follows the JSP spec, but surprises some tag library developers.
What do you think, do struts tags indeed misunderstand the JSP spec
here?