30得票5回答
@Cacheable注解在无参数方法上的应用

我想在没有参数的方法上使用@Cacheable注解。在这种情况下,我会按如下方式使用@Cacheable@Cacheable(value="usercache", key = "mykey") public string sayHello(){ return "test" } 然而,当...

23得票2回答
无法验证Spring Security中针对URL模式的角色

我正在使用Spring Security 3.1.7.RELEASE和Spring 3.2.13.RELEASE。 我的spring-security.xml文件中有以下条目:<http auto-config="true" use-expressions="true"> ...

9得票4回答
如何定义Spring中@Cacheable注解的键(key)最佳方式?

如果我为一个没有任何参数的方法定义了一个ehcache。 但在我的使用情况下,我需要通过它的键访问我的构建缓存。 因此,请提供更好的分配键的方法。 以下是我的代码: @Override @Cacheable(value = "cacheName", key = "cacheKey") ...

8得票4回答
SpelEvaluationException: EL1007E:(pos 43): 在 null 上找不到 'group' 字段或属性。

我已经完全配置了我的 Web 应用程序的 SPRING METHOD 安全性(启用了 PRE/POST 注释)。 然而,最近我遇到了一个奇怪的问题。总结如下: Summary of POJOS // User Class public class User { int id; ...