I want to write an interceptor – for all requests – do some stuff and maybe put something in the session.
I’ve registered play plugin and overriden
@Override
public void routeRequest(Request request) { ... }
from which i get a proper Request object, but trying to access
Controller.session
or
Session.current() gives me some session, but not the one that is next available to my controller.
Is it possible in play?
Or maybe there is a better way of writing and interceptor – so something that should be cross-system for each request.
Fallback i know will be to create a dedicated controller with @Before method and annotate each of the other controllers with @With to include this method, but that is kind of a repetition that I would like to avoid
I was extending the wrong method.
to have access to same session object as for controller – one must extend