My web application is generated using Jhipster framework. It is a gateway application and I am using reactive spring-boot. I can see a web.xml is generated and it has <mime-mapping>
tag inside <web-app>
. Is this actually needed for a spring-boot application?
Asked
Active
Viewed 29 times
1

Aryan
- 13
- 3
-
Probably not, it should be possible to do the same via code or maybe simply using Spring Boot defaults. This web.xml file was added years ago so it could be obsolete now. Try removing it, and get an *.html page to see if returned mime-type is correct, if it is then submit a pull request on github. – Gaël Marziou Jul 14 '23 at 18:11
-
@GaëlMarziou I removed it, and I have a spring-boot angular application generated with Jhipster. I am getting the pages as well. Could you please let me know how to verify the check what you told? – Aryan Jul 14 '23 at 20:08
-
As you have seen, this mapping is for *.html resources : JHipster has index.html for frontend app but also 404.html. So I suppose (not tested) you could simply refer to a resource that does not exist like http://localhost:8080/unknown and verify in browser's console that response mime type header is set to "text/html;charset=utf-8". You can do it also with curl. – Gaël Marziou Jul 14 '23 at 21:07
-
@GaëlMarziou I am getting the error page, but before removing and after removing the web.xml I am getting the content-type as `application/problem+json` for 404 page. Also I found this older issue: https://github.com/jhipster/generator-jhipster/issues/10698, whether this has any impact here? – Aryan Jul 17 '23 at 13:27
-
I don't know how to test it so. You're right about this issue, the web.xml makes total sense when deploying to a server rather than using embedded server. I think that there should be a comment in the file explaining it. – Gaël Marziou Jul 17 '23 at 18:00