Reputation: 39695
We have a play(2.1.2) web-service that handles json. I want to secure it by limiting the access only to the routes specified in the routes
file. But when I access the root path of the application in the browser, it shows "Action Not Found" and shows all the possible routes, I don't want to list the possible routes in the browser. Thanks.
Upvotes: 0
Views: 78
Reputation: 23881
It shows possible routes only in dev mode. When you run your application like play start
you will get just "Action Not Found" message with a description "For request 'GET /zxc'".
If you want to override this behavior, try overriding the onHandlerNotFound method on your Global
:
@Override
public Result onHandlerNotFound(RequestHeader request) {
return Results.notFound(
views.html.pageNotFound(request.uri())
);
}
More on this here: http://www.playframework.com/documentation/2.1.0/JavaGlobal
Upvotes: 3