java - #root and #this in SpEL - Stack Overflow In Spring 3 SpEL, #this and #root were introduced The variable #root is always defined and refers to the root context object Although #this may vary as components of an expression are evalu
java - Compare Enums in SpEL - Stack Overflow At Spring's @Cacheable annotation I want to specify an unless condition However my return value is neither a primitive type nor a Java bean, but an Enum How can I compare for equality with anot
Spring Expression Language (SpEL): check empty string? What is a canonical way to check if the String is null or empty using SpEL? I would like to achieve the same result as Strings isNullOrEmpty(myString) from Guava does My candidates: "#myString ?
@Cacheable key on multiple method arguments - Stack Overflow Update: Current Spring cache implementation uses all method parameters as the cache key if not specified otherwise If you want to use selected keys, refer to Arjan's answer which uses SpEL list {#isbn, #includeUsed} which is the simplest way to create unique keys From Spring Documentation The default key generation strategy changed with the release of Spring 4 0 Earlier versions of Spring
How to reference a bean by type in a SpEL? - Stack Overflow I was just answering from the SpEL perspective that to reference a @Bean whose name is created from a class name (such as with @Component), it's name has a lower case first char
How to use custom expressions in Spring Security @PreAuthorize . . . MySecurityService someFunction should have return type boolean Spring-security will automatically provide a variable named authentication if you want to pass the Authentication -object You can also use any valid SpEl-expressions to access any arguments passed to your secure method, evaluate regular expressions, call static methods, etc E g: