I have special field objects which with separate methods for jsp setting and database setting which also track changes. Then I can use reflection to the specific type and see if any of the objects in the database changed and are not confused by spurious instance variables. You can then create methods for checkpointing the data so if you have a complex set of updates you can know the status at any point. The main drawback and one I am still working on) is that for reflection to work with the field objects directly they need to be public. The Bean Utils will still work as long as your getters and setters follow the Java Bean spec.
Edgar > -----Original Message----- > From: sean schofield [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 17, 2003 9:57 AM > To: [EMAIL PROTECTED] > Subject: Design Question > > > I am working on a struts-based web application and I have an > interesting design issue that I'd like to get some feedback > on. I think this problem is actually quite generic and there > must be some good ideas out there already that I could sponge off! > > Basically I have a struts form with a bunch of fields that > will be presented to the user through the usual JSP-based > view. The user will have the opportunity to makes edits and > then submit to an action. What I would like to do is be able > to identify which fields changed and then take certain > actions based on these changes. > > Here is one rough ideas I have so far. Any thoughts on this > plus additional ideas would be greatly appreciated. > > 1.) Extend ActionForm and customize the populate method so > that it makes a copy of the old version of the form that is > already stored in the session (since it will have session scope) > > 2.) Populate new form > > 3.) Compare two forms and store list of changes in new form > > 4.) Discard copy of old. > > Any thoughts, comments? > TIA, > > sean > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]