Connecting Tech Pros Worldwide Forums | Help | Site Map

how to retain the value of a variable?

Member
 
Join Date: Feb 2007
Posts: 58
#1: Apr 24 '07
Ive got a java class having a double variable whose value is populated from the front end...
eg..
Expand|Select|Wrap|Line Numbers
  1. public class AccountsCenterAction extends AbstractReportAction {
  2.  private double closingBal;
  3.  
  4. public String method1() {
  5. //stmnts;
  6. }
  7. public String method2() {
  8. //stmnts;
  9. }
  10.  
  11. public double getClosingBal() {
  12.         return closingBal;
  13.     }
  14.     public void setClosingBal(double closingBal) {
  15.         this.closingBal = closingBal;
  16.     }
  17. }
  18.  
  19.  
ive got 2 ftl pages in frontend say page1.ftl and page2.ftl
on saving page1.ftl, i set the value of closingBal = 2300 and goes to method1().
on taking page2.ftl, i go to method2(). i need to get the value of closingBal =2300 in method2()..but im getting closingBal=0.0

how can i retain the value of closingBal when calling from another ftl..?

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Apr 24 '07

re: how to retain the value of a variable?


Quote:

Originally Posted by shiniskumar

Ive got a java class having a double variable whose value is populated from the front end...
eg..

Expand|Select|Wrap|Line Numbers
  1. public class AccountsCenterAction extends AbstractReportAction {
  2. private double closingBal;
  3.  
  4. public String method1() {
  5. //stmnts;
  6. }
  7. public String method2() {
  8. //stmnts;
  9. }
  10.  
  11. public double getClosingBal() {
  12.         return closingBal;
  13.     }
  14.     public void setClosingBal(double closingBal) {
  15.         this.closingBal = closingBal;
  16.     }
  17. }
  18.  
  19.  
ive got 2 ftl pages in frontend say page1.ftl and page2.ftl
on saving page1.ftl, i set the value of closingBal = 2300 and goes to method1().
on taking page2.ftl, i go to method2(). i need to get the value of closingBal =2300 in method2()..but im getting closingBal=0.0

how can i retain the value of closingBal when calling from another ftl..?

Post the code you are using for setting the value in the first page.
Reply