Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding the rows in a JSP

 
Eric Hanson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should not the sum row be 3 6 6 6 instead of 6 6 6 ?
 
Eric Hanson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that is actually

row1 2 2 2

row2 4 4 4

sum 6 6 6

problem with indentation, i think !
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do simple arithmetic with EL: ${row1 + row2}
 
Eric Hanson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic