Is there any special configuration one must do? or should it work out of the box?
e.g. should I add something like this to make it work?
<mime-mapping>
<extension>json</extension>
<mime-type>application/json</mime-type>
</mime-mapping>
If you are trying to make Tomcat serve .json files with the right mime type then yes, you will need to add that mime type declaration to the conf/web.xml file.
If you're serving dynamically generated JSON then it really shouldn't matter: you can set any mime type using the setContentType
function.
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