• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Audit Trail Functionality

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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



 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.

Martin James wrote:I would like to know whether my implementation is correct or it can be implemented in a better way.



That really isn't what we do here. You can browse our FAQ HowToAskQuestionsOnJavaRanch to get a better feel for what that is.
My personal rule of thumb is that something "works and can be seen to work", that is, it is well-tested, doesn't have bugs and can be understood by someone reasonably intelligent reading the code and comments.
 
Martin James
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks joe
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic