You can probably write an aspect (using AspectJ) to do this fairly
automatically -- i.e. create a pointcut for all *Form.set* methods, and then
do your comparisons there.

i.e.
public aspect DiffAspect {

  pointcut setter() : call(public void *Form.set*(..));

  before() : setter() {
    //... your comparison here...
  }
}

----- Original Message ----- 
From: "sean schofield" <[EMAIL PROTECTED]>
To: "Struts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, September 17, 2003 8:20 AM
Subject: RE: Design Question


> You are correct that my problem requires more information that just
"something changed."  But your solution may prove useful for a different
problem ...
>
> Basically the user has the option of bringing up different forms without
submitting their changes.  I'd like to be able to present them with "Are you
sure you don't want to submit your changes?" message but only if something
actually changed.  I could use onchange for each field and also keep track
of the original values but the digest idea might be nice.
>
> Thanks for the timely response.  I'd be happy to hear feedback on this
idea plus my original problem from anybody.
>
> Regards,
>
> - sean
>
> ---------- Original Message ----------------------------------
> From: "Andrew Hill" <[EMAIL PROTECTED]>
> Reply-To: <[EMAIL PROTECTED]>
> Date:  Wed, 17 Sep 2003 23:02:41 +0800
>
> >oops.
> >Forget what I said - didnt read it properly. You need to be able to tell
> >which fields changed. The digest will merely tell you if any changed.
Sorry.
> >
> >-----Original Message-----
> >From: Andrew Hill [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, 17 September 2003 23:01
> >To: Struts Users Mailing List
> >Subject: RE: Design Question
> >
> >
> >Actually you could just store a digest of the previous values, and then
> >compare that with a digest of the new.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to