dcsimg
How to calculate values in JSP using JSTL
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jyri_Saastamoinen
Posted On:   Saturday, November 15, 2003 03:33 AM

Hello.

I need to calculate total amount of cars:



10
....


20
....



I've a JSP page and I'm using a JSTL. Is it possible to calculate total amount? If it is, how can I do That
How can I get content of amount-element and do the calculation?

Re: How to calculate values in JSP using JSTL

Posted By:   AlessandroA_Garbagnati  
Posted On:   Saturday, November 15, 2003 06:43 AM

Hi,

You need to read the XML file and the parse it. Once you have done that, you can use the XPath syntax to get the summed value.

Here is an example in a jsp page:

<%@ taglib uri="/jstl/core" prefix="c" %>
<%@ taglib uri="/jstl/xml" prefix="x" %>




10


20





Total Cars =
About | Sitemap | Contact