【发布时间】:2016-01-27 18:32:54
【问题描述】:
我想在没有参数的方法上添加@Cacheable 注释。在这种情况下,我使用@Cacheable 如下
@Cacheable(value="usercache", key = "mykey")
public string sayHello(){
return "test"
}
但是,当我调用此方法时,它没有被执行,并且出现如下异常
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'mykey' cannot be found on type of 'org.springframework.cache.interceptor.CacheExpressionRootObject' - 也许不公开?
请提出建议。
【问题讨论】:
标签: spring ehcache spelevaluationexception