You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "K OSSUser (JIRA)" <ji...@apache.org> on 2014/03/27 13:24:14 UTC

[jira] [Created] (WW-4312) A problem on Iterator tag

K OSSUser created WW-4312:
-----------------------------

             Summary: A problem on Iterator tag
                 Key: WW-4312
                 URL: https://issues.apache.org/jira/browse/WW-4312
             Project: Struts 2
          Issue Type: Bug
          Components: Other
    Affects Versions: 2.3.15
            Reporter: K OSSUser
            Priority: Minor


I can't explain well so see below.

Expected "1, 2, , 3," but the result was "1, 2, 2, 3,".

Test.jsp
-------------------------------------------------------------------
<s:iterator value="%{{{1, 2},{null, 3}}}" var="var1">
<s:iterator value="#var1" var="var2">
<s:property value="#var2" />,
</s:iterator>
</s:iterator>
-------------------------------------------------------------------

I changed below class then it was fixed.

org.apache.struts2.components.IteratorComponent#start
-------------------------------------------------------------------
//  if ((var != null) && (currentValue != null)) { <= Old.
    if (var != null) { // <= New.
        //pageContext.setAttribute(id, currentValue);
        //pageContext.setAttribute(id, currentValue, PageContext.REQUEST_SCOPE);
        putInContext(currentValue);
    }
-------------------------------------------------------------------




--
This message was sent by Atlassian JIRA
(v6.2#6252)