I am using Play framework 2.2.3. I want to respond to invalid JSON requests with a JSON response saying response type is invalid JSON like
{"message": "invalid json"}
but Play by default sends html data. I am using
@BodyParser.Of(BodyParser.Json.class)
annotation for my action method in the controller class. How do I send a JSON response instead of the default html response?