File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Audit Trail Functionality Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Audit Trail Functionality" Watch "Audit Trail Functionality" New topic
Author

Audit Trail Functionality

Martin James
Greenhorn

Joined: Feb 25, 2011
Posts: 2
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



Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8291

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Martin James
Greenhorn

Joined: Feb 25, 2011
Posts: 2
Thanks joe
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Audit Trail Functionality
 
Similar Threads
DB insert in a low priority thread
Struts2-json plugin not serializing action class to json
Audit Trail for Web Application
Audit Logging
Handling Ajax response in struts2