大佬教程收集整理的这篇文章主要介绍了Spring Aspectj @所有其余方法之前,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我发现这句法这里对我的作品!
@pointcut("execution(@(@org.springframework.web.bind.Annotation.requestMapPing *) * *(..))")
public voID requestMapPingAnnotations() { }
我也可以全部列出
@pointcut("within(aa.bb.*.rest..*) && @within(org.springframework.web.bind.Annotation.RestController)")
public voID restControllers() {}
@pointcut("@Annotation(org.springframework.web.bind.Annotation.requestMapPing) " +
"|| @Annotation(org.springframework.web.bind.Annotation.GetMapPing)" +
"|| @Annotation(org.springframework.web.bind.Annotation.PostMapPing)" +
"|| @Annotation(org.springframework.web.bind.Annotation.PatchMapPing)" +
"|| @Annotation(org.springframework.web.bind.Annotation.PutMapPing)" +
"|| @Annotation(org.springframework.web.bind.Annotation.deleteMapPing)"
)
public voID mapPingAnnotations() {}
@pointcut("execution(@(@org.springframework.web.bind.Annotation.requestMapPing *) * *(..))")
public voID requestMapPingAnnotations() { }
@Before("restControllers() && requestMapPingAnnotations()")
public voID onExecute(JoinPoint jp) {}
在春季介绍之前@GetMapping
,我们只关心一个注释@requestMapping
,因此,此方面有效
@Before("within(aa.bb.*.rest..*) && execution(public * *(..)) && @within(org.springframework.web.bind.Annotation.RestController) && @Annotation(org.springframework.web.bind.Annotation.requestMapping)")
但是,在我们可以使用@GetMapping
之后@PostMapping
,这一点不起作用,但是这些注释具有meta注释@requestMapping
。
有什么办法可以轻松拦截所有@requestMapping
/ @{Get,Post,Put,Patch,..}Mapping
吗?
以上是大佬教程为你收集整理的Spring Aspectj @所有其余方法之前全部内容,希望文章能够帮你解决Spring Aspectj @所有其余方法之前所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。