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

Reply via email to