Tags such as the JSTL <x:out> tag that have idempotent attribute values are being reinitialized before use. The specification allows the container to pool and reuse tags with the same attribute values, calling them multiple times without reinitializing the values. However, the code generated by Jasper always sets the attribute values after retrieving an instance from the pool even if they have constant values.
Created attachment 25757 [details] Test JSP
Created attachment 25758 [details] Java source generated by Jasper <jspc> ant task Relevant snippet from end // x:out org.apache.taglibs.standard.tag.rt.xml.ExprTag _jspx_th_x_005fout_005f0 = (org.apache.taglibs.standard.tag.rt.xml.ExprTag) _005fjspx_005ftagPool_005fx_005fout_0026_005fselect_005fnobody.get(org.apache.taglibs.standard.tag.rt.xml.ExprTag.class); _jspx_th_x_005fout_005f0.setPageContext(_jspx_page_context); _jspx_th_x_005fout_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_x_005fforEach_005f0); // /org/apache/taglibs/standard/tag/el/xml/TestForEachPerformance.jsp(24,67) name = select type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_x_005fout_005f0.setSelect("y"); int _jspx_eval_x_005fout_005f0 = _jspx_th_x_005fout_005f0.doStartTag();
I'm leaning towards marking this as WONTFIX. Trying to write the code to do this even for simple cases looks like it will increase the complexity of the generation code significantly.
As per comment #3, closing.