One way is to have a old and new variable in your form bean.  Leave all the
old variables empty when the form bean is sent to the jsp for the first
time.  When the user makes their changes and submits them check in the set
method of the form bean to see if the data changed.  If it did then save the
original value to the old variable and then set the new value into your
variable.  

Jeff Krueger


-----Original Message-----
From: Hudayioglu, Fehmi
To: 'Struts Users Mailing List'
Sent: 12/14/2001 9:17 AM
Subject: AW: possible to keep old and new values inside of a form bean

Again hi guys,

lets say that I want to compare these values in the action bean. Is it
possible to use the form bean that stores our old data, and the form
that is
populated by the new data for comparison? I hope i am not confusing.

thanks again.

-----Urspr�ngliche Nachricht-----
Von: Keith Bacon [mailto:[EMAIL PROTECTED]]
Gesendet am: Friday, December 14, 2001 3:00 PM
An: Struts Users Mailing List
Betreff: Re: possible to keep old and new values inside of a form bean

Hi Fehmi.
I think you should do things like this in your Action
class rather than the Form bean - which should
strictly be used for data that goes from forms to
Action class & vice versa.
This is part of your business logic (or maybe of DB
integrity checking) - so if your system is large(ish)
you'll want to have that logic in classes called from
your Action class.
Keith.



--- "Hudayioglu, Fehmi"
<[EMAIL PROTECTED]> wrote:
> Hi folks,
> 
> I am sending two values to form bean and then user
> have the privilege to
> change these two values. To restore the database I
> must also store the old
> values that I have conveyed to screen from the
> formbean but as the user
> alters the data my old values are vanished. What
> will be the effective
> solution to store the old values in the form bean
> while also retrieving the
> new values for comparing and sending the changed
> ones to the servlet.
> 
> Cheers,
> Fehmi.
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to