Grails—在Spring3.1'中使用Spring el表达式;s@可缓存
我们计划使用Spring3.1缓存抽象,而不是GrailsSpringCache插件。我已经在本地进行了实验,但是在使用Spring el表达式时出现了一个问题,例如Grails—在Spring3.1'中使用Spring el表达式;s@可缓存,spring,caching,grails,groovy,Spring,Caching,Grails,Groovy,我们计划使用Spring3.1缓存抽象,而不是GrailsSpringCache插件。我已经在本地进行了实验,但是在使用Spring el表达式时出现了一个问题,例如 @Cacheable(value = 'dashboardCache', key = 'sessionStorageService.getUser()', condition = 'sessionStorageService.getUser() != null') public List<BusinessDashboard&
@Cacheable(value = 'dashboardCache', key = 'sessionStorageService.getUser()', condition = 'sessionStorageService.getUser() != null')
public List<BusinessDashboard> getUserDashboards(String serverName, SessionStorageService sessionStorageService) { ... }
我假设这种行为是由于缺少调试信息造成的-因此我的问题是:
Spring el表达式可以在Grails应用程序中启用吗,或者编译过程中是否有任何参数告诉Grails在类文件中保留调试符号
(我们在Grails 2.0.1上运行)您应该尝试“#sessionStorageService.getUser()”您应该尝试“#sessionStorageService.getUser()”
EL1008E:(pos 0): Field or property 'sessionStorageService' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'sessionStorageService' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'