RSS Feed Subscribe to RSS Feed

 

415 ‘Unsupported Media Type’ error when submitting JSON from a JSP

I’ve been experimenting with submitting JSON data from a JSP to a Spring MVC Controller, using the Spring MVC Ajax example as my guide.

But after setting everything up, I continually ran into this error:

NetworkError: 415 Unsupported Media Type
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method().

After much googling, I found a plethora of solutions, none of which worked for me. In the end, I found it was because I had omitted this line from my JSP:

Hope that helps someone else…

Tags: , , ,

Leave a Reply