wood burning stoves 2.0*
The moose likes JSP and the fly likes Adding the rows in a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Adding the rows in a JSP" Watch "Adding the rows in a JSP" New topic
Author

Adding the rows in a JSP

Eric Hanson
Greenhorn

Joined: Feb 08, 2006
Posts: 5
Hi,

I have this scenario where i dynamically display the rows on the jsp. Now need to give a row in the end which sums up all the columns in the end which i call the sum row.

How do i get this?

ex: row1 2 2 2
row2 4 4 4
sum 6 6 6

regards,
Eric
karthikeyan Chockalingam
Ranch Hand

Joined: Sep 06, 2003
Posts: 259
Should not the sum row be 3 6 6 6 instead of 6 6 6 ?


http://www.skillassert.com


Eric Hanson
Greenhorn

Joined: Feb 08, 2006
Posts: 5
that is actually

row1 2 2 2

row2 4 4 4

sum 6 6 6

problem with indentation, i think !
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
You can do simple arithmetic with EL: ${row1 + row2}
Eric Hanson
Greenhorn

Joined: Feb 08, 2006
Posts: 5
But the rows are populated dynamically. I do not know how many rows will be returned at one time. I need to have the sum of all the rows in the end of the page.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Eric Hanson:
But the rows are populated dynamically. I do not know how many rows will be returned at one time. I need to have the sum of all the rows in the end of the page.


http://www.coderanch.com/t/289003/JSP/java/adding-rows-displayed-JSP-as
 
Don't get me started about those stupid light bulbs.
 
subject: Adding the rows in a JSP
 
Similar Threads
adding rows displayed on JSP as SUM
passing JS values between 2 pages
using OGNL
nested for loops, need more assignment help....
JTable and getValueAt(int, int)