• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to perform manipulation on form-bean variables??

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

Following is some code in my JSP file in my struts application:-
============================
<tr>
<td>UNITS</td><td>UNIT PRICE</td><td>SUB TOTAL</td>
</tr>
<tr>
<td><bean:write id="cartbean" property="units"></td>
<td><bean:write id="cartbean" property="unit_price"></td>
<td> ??? /td>
</tr>
============================
Now in my above application code I am successfuly retrieving values of "units" &

"unit_price" fields from my form-bean. But now I want to display multiplication of "units" &

"unit_price"into "SUB TOTAL" column. How should I do this in my JSP?

What code should I write so that I can multiply these two fields & display values in third

column???

PLease help me.

Thanx in advance...

Prash
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd suggest you add a method to your ActionForm bean to do this. For example:



You can then simply put <bean:write id="cartbean" property="totalPrice"> in your JSP.
reply
    Bookmark Topic Watch Topic
  • New Topic