rest - How to use @Before advice with multiple pointcuts? -
i have written @before advice invoked following methods belong same class named mpicontroller.
transactiontype is custom annotation interface.
and methods are:
1. @requestmapping(value = "/getpatient", method = { requestmethod.post,requestmethod.put }, consumes = "application/json", produces = "application/json") @transactiontype(value = "fetch_patient") public @responsebody fetchpatientresponse fetchpatientdemographics( @requestbody string jsonobject, httpservletresponse response, httpservletrequest request, bindingresult error) { ... } ..
2. @transactiontype(value = "update_patient") private persistresponse updatepatient(string jsonobject,string patientdemo, string fromcode) {..} ..
3. @transactiontype(value = "register_patient") private persistresponse registerpatient(string jsonobject,string patientdemo, string fromcode) {..} my advice looks this.
@before("execution(* com.rest.controller.mpicontroller.*(..)) &&args(jsonobject,..) && @annotation(transactiontype) ") public void log(string jsonobject,transactiontype transactiontype){..} the @before advice invoked "fetchpatientdemographics() method,however not work rest 2 methods.
can tell me doing wrong here?
method 2 , 3 being called other method in same class.they not directly invoked.can issue?
Comments
Post a Comment