Spring Aop中解析spel表达式,实现更灵活的功能

前言 在Spring Aop中,我们可以拿到拦截方法的参数,如果能结合spel表达式,就能实现更加灵活的功能。典型的实现有Spring的缓存注解: 1@Cacheable(value = "user", key = "#id", condition = "#id lt 10") 2public User conditionFindById(final Long id) { 3} 1@Caching(put = { 2@CachePut(value = "user", key = "#user.id"), 3@CachePut(value = "user", key = "#user.username"), 4@CachePut(value = "user", key = "#user.email") 5}) 6public User save(User user) { 本文介绍如何在aop编程中解析spel表达式,提供几个通用的方法。 ...

2019年2月25日 · 2 分钟 · 865 字
👋欢迎来到我的技术博客🌟
这是一片专注于前沿技术探索的园地,涵盖:
  • Web3与区块链(BTC、ETH、区块链基础设施)
  • 后端技术栈(Java、Go、Python)
  • 人工智能与数据科学(ML、DL、数据挖掘)
  • 系统安全与运维(服务器、网络、容器化)
📫 联系方式