Bug 49589

Summary: Tag handlers with constant attribute values are always reinitialized
Product: Tomcat 7 Reporter: Jeremy Boynes <jboynes>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: P2    
Version: trunk   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Test JSP
Java source generated by Jasper <jspc> ant task

Description Jeremy Boynes 2010-07-12 21:30:47 UTC
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.
Comment 1 Jeremy Boynes 2010-07-12 21:33:02 UTC
Created attachment 25757 [details]
Test JSP
Comment 2 Jeremy Boynes 2010-07-12 21:35:05 UTC
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();
Comment 3 Mark Thomas 2012-01-22 19:45:04 UTC
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.
Comment 4 Mark Thomas 2017-04-07 16:46:35 UTC
As per comment #3, closing.