reidis设置key org.springframework.expression.spel.SpelEvaluationException: EL1008E

在使用springboot集成redis,service实现层增加@Cacheable注解中的key,以为可以自定义,随便写写,在运行时

key org.springframework.expression.spel.SpelEvaluationException: EL1008E

改之前
@Cacheable(value = "user_list",key ="findAll", unless = "#result==null")// findAll为注解的方法名
   
改之后

@Cacheable(value = "user_list",key ="#root.methodName", unless = "#result==null")//必须通过root.methodName获取方法名或者
,key="数字",也可以

 
 

愿菜鸡共勉  [捂脸]


猜你喜欢

转载自blog.csdn.net/qq_24084605/article/details/81002690