Anupam Kumar
Anupam Kumar

Reputation: 1

onRequest() is not working in Play! framework 2.5.x

I want to execute business logic before a request is dispatched to an action.

This is my code:

public class Global extends GlobalSettings {

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

}

But it is not working.

Upvotes: 0

Views: 236

Answers (1)

Steve Chaloner
Steve Chaloner

Reputation: 8202

The use of Global is deprecated in Play 2.5 as part of the move away from global state.

Use filters instead. You can find a detailed breakdown in the documentation.

Upvotes: 1

Related Questions