I have a spring action that I am rendering some json from the controller, at the minute its returning the content type 'text/plain;charset=ISO-8859-1'.
How can I change this to be 'application/json'?
Pass the HttpServletResponse
to your action method and set the content type there:
public String yourAction(HttpServletResponse response) {
response.setContentType("application/json");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With