用@RequestMapping注释@Controller方法的拦截调用

我想拦截带有@Controller注释的类及其方法,这些方法甚至与作为父级的@RequestMapping匹配(不是正确的术语)?像@GetMapping和@PostMapping一样,其他应该被捕获

这将获得所有方法

@Around("within(@org.springframework.stereotype.Controller *)")

由于某种原因,它仅捕获PostMapping而不捕获GetMapping ??

 @Pointcut("@target(org.springframework.stereotype.Controller)")
    public void annotatedControllers() {}

 @Pointcut("@annotation(org.springframework.web.bind.annotation.RequestMapping)")
    public void requestMappingAnnotations() {}

 @Around("annotatedControllers() && requestMappingAnnotations()")
wwz1989 回答:用@RequestMapping注释@Controller方法的拦截调用

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3097597.html

大家都在问