I think his point is that his view template is going to iterate these objects anyways, he just did not include the additional layout html for the resultsList. I don't think he was suggesting that getting a count by looping is better done in JSP tags rather than the action class. I am sure there is some form of branching logic that is also not shown otherwise he would just use resultsList.size.
DNewfield wrote: > > Bhaarat Sharma wrote: >> But in this case why would I write another for loop to do >> something that can be done in the for loop that I already have? > > Maybe learning about the life cycle of even a simple tag will convince > you that doing unnecessary computation within the display layer is a > mistake: > > http://java.sun.com/webservices/docs/1.6/api/javax/servlet/jsp/tagext/Tag.html > > Especially the more complex life cycles of more detailed tags (since > s:set can have a body, it's got to implement BodyTag, I believe) : > > http://java.sun.com/webservices/docs/1.6/api/javax/servlet/jsp/tagext/IterationTag.html > http://java.sun.com/webservices/docs/1.6/api/javax/servlet/jsp/tagext/BodyTag.html > > And since your summation actually did the work through OGNL, you also > add the parsing/evaluation computational expense each time through that > loop. > > -Dale > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://www.nabble.com/adding-values-to-a-variable-inside-iterator-tag-tp24256987p24326480.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org