In case anyone's curious, here's the synopsis of my solution:
- Manually annotate (Java 1.5) the private fields I want to "track".
- Have a base class that stores the original state (when a record is
first loaded from the database, for editing, for example).
- Write a class that walks through the annotated fields, getting their
type from attributes (types are things like
simple--hidden,text,etc--nested, or mapped), and writes <input
type="hidden"...> tags for each one.
- Make a tag library to output the JS (exporting page context variables
is a magical thing indeed) for checking for changes.
- Unit test for a few days :)
The tricky part was the map-based nested beans. The easy part was
outputting the <input type="hidden"...> tags. The hard part was
realizing that BeanUtils.cloneBean does a shallow copy of Maps.
Fortunately, the code that walked through the annotations was also able
to deep-copy the bean.
- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]