Mantis - Resin
Viewing Issue Advanced Details
517 minor always 12-19-05 14:46 01-10-06 16:04
ferg  
ferg  
urgent  
closed  
fixed  
none    
none 3.0.17  
0000517: tag descriptor and setValue
(rep by Bill Au)

We have discovered a bug with the Resin Pro 3.0.14 JSP compiler.
I can't open a bug on the new BugTrack so I am reporting it her.

In a nutshell, when a custom tag is created as a 'tagfile' (JSP 2.0
feature) and compiled to its tag handler, the setter for an attribute
named 'value' is incorrectly generated such that the handler's internal
field representing the attribute is never actually assigned its, er,
*value*. Naming the attribute something other than 'value' gets around
this, but this seems to be a very annoying problem as 'value' is a
highly appropriate name for an attribute.

Enclosed is a test case that we have made up. It creates two custom
tags, one uses "amount" as an attribute name and the other uses
"value". Upon inspecting the generated code:

public class _bad__tag extends com.caucho.jsp.java.JspTagSupport {
  private boolean _caucho_isDead;

  private java.lang.Integer value;
  private boolean _jsp_value_isSet;

  public void setValue(java.lang.Integer value)
  {
    _jsp_value_isSet = true;
    value = value;
  }

  public java.lang.Integer getValue()
  {
    return value;
  }

We found that the setter method of the attribute doesn't qualify the
attribute name ('this.value') when assigning its, er, value from the
passed parameter.

(see attachments)

Notes
(0000669)
ferg   
01-10-06 16:04   
jsp/101i