0
背景:
我正在使用Spring MVC开发Web应用程序。如何使用参数化注释指定方法及其与@Pointcut的值
我想创建一个在POST请求上执行并且不在GET请求上执行的方面,因为我想注入阻止在HTML呈现完成之前发送的POST请求的逻辑。
@RequestMapping(value = "/aaa", method = RequestMethod.POST)
public String methodForPost(AnDto dto, Model model) {
// the aspect should be executed on this method
}
@RequestMapping(value = "/bbb", method = RequestMethod.GET)
public String methodForGET(AnDto dto, Model model) {
// the aspect shouldn't be executed on this method
}
问:
- 我如何与参数注释及其与
@Pointcut
值指定的方法? - 如何在弹簧
applicationContext.xml
中指定带参数化注释的方法及其值<aop:pointcut>
?