我从controller
返回值。设为ResponseEntity<String>
类型。
控制器返回:
new ResponseEntity<String>("{\"msg\":\"success\"}",HttpStatus.OK);
以下值转到我的spring aspect
。我在以下代码中收到此对象:
@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);
}
我知道那里有is @AfterReturning
。是以任何方式操纵数据并实现这一目标吗?
答案 0 :(得分:1)