I have encountered a strange behavior in
Tomcat 4.04 recently. If I write a simple tag which extends TagSupport, and one of my attributes is read/write, then Jasper bombs during compilation of any page which uses this tag attribute with a "Unable to find setter method for attribute" exception.
My reason for making some attributes read/write is that I want cooperating tags (nested inside the outer tag) to read their values. For example:
<ui:columns defaultWidth="20">
<ui:column width="25">Custom width</ui:column>
<ui:column>Default width</ui:column>
</ui:columns>
So the "columns" tag needs both a setter and a getter for the attribute "defaultWidth".
Anyway, if the "columns" tag includes a getter like:
public int getDefaultWidth() { return width; }
Then I'll get the compile error. If I make the getter non-public like so, then it's fine:
int getDefaultWidth() { return width; }
All this to ask a simple question: does the tag library standard state that attributes must be write-only?
Thanks.