Consider following snippet, I am trying to call a method of propertiesContainer which would be used as a key.
@Cacheable(value = EhCacheManagerApi.CACHE_X_TOKEN, key = ("#{propertiesContainer.getId()}"))
public String getToken(PropertiesContainer propertiesContainer)
I cannot seem to figure out the correct spel expression for key, current format gives me:
org.springframework.expression.spel.SpelParseException: EL1043E:(pos 1): Unexpected token. Expected 'identifier' but was 'lcurly({)'
Before I tried key = ("#propertiesContainer.id")
and key = ("#propertiesContainer.getId()")
propertiesContainer is an interface which has method getId
returning String
.
So presumably this is not the same as bean method invocation with SpEL?