aspose file tools*
The moose likes Struts and the fly likes How to perform manipulation on form-bean variables?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to perform manipulation on form-bean variables??" Watch "How to perform manipulation on form-bean variables??" New topic
Author

How to perform manipulation on form-bean variables??

Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
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


********Deserve Before You Desire********
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to perform manipulation on form-bean variables??