Mantis - Resin
Viewing Issue Advanced Details
6011 major always 06-14-16 11:01 11-11-16 15:13
rotty3000  
ferg  
normal  
closed 4.0.47  
no change required  
none    
none  
0006011: JSP Compiler ignores static input to tag attribute defined as rtexprvalue=true
Hello,

I'm experiencing a very strange issue where on certain attributes (not all of them) the JSP compiler doesn't generate set methods when a tag uses a static value for an attribute defined as being rtexprvalue=true

e.g. suppose my tag "myTag" has:
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>type</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>

and suppose the tag is used like so:
<foo:myTag name="Ray" type="hidden" />

the JSP compiler produces java code like:

_jsp_MyTag_2 = _jsp_state.get_jsp_MyTag_2(pageContext, _jsp_parent_tag);
_jsp_MyTag_2.setName("Ray");
int _jspEval16 = _jsp_MyTag_2.doStartTag();

Note the type attribute is not even generated into the java output.

Is there some sort of flag to the JSP compiler to work around this issue? Or what combination of state causes the JSP compiler to omit an attribute from being emitted.

Thx!

Notes
(0006724)
ferg   
11-11-16 15:13   
Tag attributes remain set when they are reused. This means that the second call to the same tag does not need to set the attribute.

  <foo:myTag name="First" type="hidden"/>
  <foo:myTag name="Ray" type="hidden"/>

The second tag does not call setType because it was already called for the first instance.

The tag implementation must not clear attributes at the end of the call.

jsp/1o71