How to construct a custom error json response using the Struts framework
I am working on creating a web application using struts. I want to send out a error JSON response like the below when the request URL is not well formed { “status”: 409, "code": 40924 “property”: “aggregation”, “message”: “aggregationId not specified.”, “moreInfo”: “https://www.iiitb-swn.com/docs/api/errors/40924” } I am already using the struts2-json plugin for serializing response objects using JSON. How should I go about sending JSON error responses. I can think of the below way of doing the same. Use an error response object in the action class and set all name required name value pairs