Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002029 [Resin] minor always 09-26-07 07:12 09-26-07 07:19
Reporter sam View Status public  
Assigned To ferg
Priority urgent Resolution no change required  
Status closed   Product Version 3.1.2
Summary 0002029: attribute setter is not called for tag if the value has not changed
Description (rep by T Fukuda)

The s2struts package contains a LinkTag that changes to value of an internal member variable that corresponds to an attribute within the doStartTag.

Resin does not call the setter unless that value has changed.

For example, the following does not work:

public class SampleTag extends BodyTagSupport {

    private String name = null;

    public void setName(String name) {
        this.name = name;
    }

    public int doStartTag() throws JspException {

        try {
            JspWriter writer = pageContext.getOut();
            writer.write(this.name);
        } catch (IOException e) {
            throw new JspException(e);
        }

        this.name = "---";

        return EVAL_BODY_BUFFERED;
    }
}

<%
for (int i = 0; i < 3; i++) {
%>
  <f:bar name="<%= "value" + i %>" />

<%
}
%>

<%
for (int i = 0; i < 3; i++) {
%>
  <f:bar name="aaa" />

<%
}
%>

value0
value1
value2
aaa
---
---

Additional Information https://www.seasar.org/svn/s2struts/trunk/s2struts/src/main/java/org/seasar/struts/taglib/html/LinkTag.java [^]
Attached Files

- Relationships

- Notes
(0002313)
sam
09-26-07 07:16

Resins behaviour is conformant with the specification.

The JSP 2.1 spec states:

"Once properly set, all properties are expected to be persistent, so that if the JSP container ascertains that a property has already been set on a given tag handler instance, it must not set it again."

and

"If a tag handler is used for more than one occurence, the container must reset all attributes where the values differ between the custom action occurrences. Attributes with the same value in all occurrences must not be reset. If an attribute value is set as a request-time attribute value (using a scripting or an EL expression), the container must reset the attribute between all reuses of the tag handler instance."
 
(0002314)
ferg
09-26-07 07:18

Resin's behavior is correct.

To work around buggy tag libraries, you can use

  <jsp recycle-tags="false"/>
 

- Issue History
Date Modified Username Field Change
09-26-07 07:12 sam New Issue
09-26-07 07:16 sam Note Added: 0002313
09-26-07 07:18 ferg Note Added: 0002314
09-26-07 07:18 ferg Assigned To  => ferg
09-26-07 07:18 ferg Status new => assigned
09-26-07 07:18 ferg Resolution open => no change required
09-26-07 07:19 ferg Status assigned => closed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker