java - 切入点引用名称以开头的所有方法
问题描述
我试图在我的代码中实现一个简单的切入点表达式,这是我的 Aspect 类
@Aspect
public class PaymentAspect {
@Autowired
private OrdineService ordineService;
@Pointcut("execution(* *..createPayment*(..))")
public void toVerifyCart() {}
@Before("toVerifyCart()")
public void validateCart(JoinPoint jp) throws ServiceException, TokenStreamException {
//Instructions...
}
}
这是我想调用 validateCart() 方法的方法之一......
public String createPayment(@RequestData(paramaterName = "httpRequest") Long cartID,
String currency, String appContext,
@RequestData(paramaterName = "httpRequest") HttpServletRequest request) throws ServiceException;
唯一的问题是我的代码根本没有调用方法......我在这里有什么问题吗?
解决方案
尝试@Pointcut("execution(* createPayment*(..))")
推荐阅读
- python - 使用 pip 安装自定义包的 Anaconda ModuleNotFoundError
- reactjs - 如何将标签添加/对齐到语义 UI 下拉控件
- c# - 管道大小调整 C# 代码给出了不需要的结果
- r - 如何根据 R 中的条件拆分字符串?
- html - 页面上未显示的组件变量(Angular6)
- c# - 以安全的方式使用托管的 asmx
- django - 无法解决 AttributeError:“模块”对象在安装 django 依赖项时没有属性“SSL_ST_INIT”
- c# - xUnit .NET Core 多个 InlineData 输入分别具有不同的期望
- git - 使用 Git [分支] 直接合并
- java - 为什么弹性搜索“术语查询”中不同“滚动”时间消耗的时间如此不同