Play framework - overwrite onRouteRequest in java

I would like to get around Games 2 routes and return my handler to Global, looking for help on how we can do this. Preferred in Java, but if this is not possible, scala is excellent.

public Handler onRouteRequest(play.mvc.Http.RequestHeader request){
//return my Handler here, not the super.onRouteRequest
}
+4
source share
1 answer

Yes, this is possible with "Overriding onRequest".

`@Overridepublic
Action onRequest(Request request, Method actionMethod) {
   System.out.println("before each request..." + request.toString());
   return super.onRequest(request, actionMethod);
}`

The above code is directly used for the Play site framework (for Java).

For Scala, here is the link.

0
source

Source: https://habr.com/ru/post/1524402/


All Articles