is there a way to have a controller method to automatically call a another method.
i am asking this because i am planning to create a base controller where in all extending controller, i need to log some http header for audit and site metrics reports.
example
now my extending class would be like thisCode:public BaseController extends MultiActionController{ public void myAudit(HttpServletRequest request){ .... code to save my required header info ....like referrer,browser agent,etc to database } }
as you can see i can call myAudit from the method (programatically) if i want to, but is there a way to call myAudit function automatically whenever a method from the extending class of my BaseController is called. or am I asking too much.Code:public Controller1 extends BaseController{ public ModelAndView vetsHandler(HttpServletRequest request, HttpServletResponse response) throws ServletException { //i can call myAudit(request) from here return new ModelAndView("vetssView"); } }
anyway, need suggestion from any expert out there.
thanks.



Reply With Quote