We are trying to follow the "Caching in templates" example listed in http://www.playframework.com/documentation/2.1.1/JavaCache and the compiler throws us an "not enough arguments for method getOrElse
" exception message.
Our code in the template:
@play.cache.Cache.getOrElse("cached-content", 3600){
test
}
So we decided to dig the API and apparently we still short of java.util.concurrent.Callable
parameter. Does anyone know what should we pass in for that parameter?
Thanks
it's because you are trying to use a Java API from a Scala template with the syntaxe of the Scala cache API. If you want to use the example from the documentation you need to write something like :
the play.api package is the package for Scala APIs.
If you want to use the Java Cache API from a template, this API takes 3 parameters and you need to write something like :