This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes add collection values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "add collection values" Watch "add collection values" New topic

add collection values

arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125

I am getting values of total in six rows for example
in first row 2,in second row 2 like that from a map in action class(strut web application)

<logic:iterate id="ele" name="daMap">
<logic resent name="ele" property="value">
<bean efine id="ia" name="ele" property="value"/>
<bean:write name="ia" property="numeric"/>
</logic resent>

now issue is i need to add these value and show that result on same page after these rows

whether it is possible or not.if yes how

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest creating a method such as getTotal() in your ActionForm bean that reads the HashMap and calculates the total.

You can then display it like this:

<bean:write name="myActionForm" property="total" />

Consultant, Sima Solutions
subject: add collection values
Similar Threads
how to apply continue statement in struts logic:iterate tag
add map values
Logic iterate
Retrieve values from Object[][] using iterator
Cannot set parameter in HTML:Link