I'm returning value from my controller. Let it be ResponseEntity<String> type.
Controller returns:
new ResponseEntity<String>("{\"msg\":\"success\"}",HttpStatus.OK); Following value goes to my spring aspect. I am receiving this object in following code:
@AfterReturning(pointcut = "somePointcut()",returning = "retVal") public ResponseEntity<String> adviceTest3(Object retVal) { //here i have access to controller's object return new ResponseEntity<String>("{\"msg\":\"changed value within aspect\"}",HttpStatus.OK); } I'm aware that there is @AfterReturning. Is it any way manipulate data and achieve that?