Hi All,
I need to capture all the changes made by the user(screen level) and save the old/new value to the DB for auditing purpose.I have an implementation for audit trail in my application as stated below.I would like to know whether my implementation is correct or it can be implemented in a better way.
For all the components(text,textarea,combo etc) used in the application i have included an attribute say "defaultText" which holds the initial value of the component on load of the page.For this i have included the variable "defaultText" in the FTL file for each component.On submitting the form i create a JSON
string by comparing old value to the new value and send it to the server.An interceptor intercepts all CRUD action calls which parse the JSON string and inserts it to the corresponding table if the action is successful.I am using struts2.Please let me know your valuable suggestions.Thank you.
Regards,
Martin James