I am using action composition of play framework 2.3 and I would like to send parameters to the custom action.
For example, if you have a custom action that adds a cache how the custom action can receive the cache key and the desired cache time. Example code inside a play controller:
def myAction(p1: String) = CachedAction(key="myAction1"+p1, time = 300.seconds) {
implicit request =>
... do an expensive calculation …
Ok(views.html.example.template())
}
I have tested an ActionBuilder combined with a custom request but I haven't found a solution.
I am aware that play offers a cache for actions, unfortunately that cache does not meet all the requirements.