[ https://issues.apache.org/jira/browse/WW-3317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart updated WW-3317: ------------------------------ Fix Version/s: Future I don't think so it should be implemented inside s:iterator tag, it would be better to do this in Action/Java class > An Attribute or inner tag required to specify the break condition for > <s:iterator> tag. > --------------------------------------------------------------------------------------- > > Key: WW-3317 > URL: https://issues.apache.org/jira/browse/WW-3317 > Project: Struts 2 > Issue Type: Improvement > Components: Plugin - Tags > Affects Versions: 2.1.2 > Reporter: Muthu Velappan > Priority: Minor > Fix For: Future > > > As of now, there is no way to break from a iterator by specifying a condition > in <s:iterator> tag. Round about way that we all use now is to > <s:set var="testCondition" value="%{false}"/> > <s:iterator> > <s:if test="%{!#testCondition}"> > ... > <Your Actual BL> > ... > < Finally, break condition check and then set the boolean to true, so > that further iteration will not process this statements> > <s:set var="testCondition" value="%{true}"/> > <End of break condition> > </s:if> > </s:iterator> > The problem with this is even when boolean is set at first iteration of the > loop, the iterator will process all the items in the collection because we > are not breaking the loop. We just added a condition to make sure the > statements inside that loop is not executed. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira