Why is Jetty serving css with text/html content type

北战南征 提交于 2019-12-02 03:31:16

The CSS file is typically served from the org.eclipse.jetty.servlet.DefaultServlet.

Which is declared in the etc/webdefault.xml file in the distribution.

Since you are using embedded mode, you'll want to provide this manually by calling WebAppContext.setDefaultsDescriptor(String) with the path to your etc/webdefault.xml file.

And finally, the mime types themselves are loaded by the DefaultServlet via the mime.properties file, which is loaded by Jetty via a call to Classloader.getResource("/org/eclipse/jetty/http/mime.properties").

Note: the mime.properties file is found in the jetty-http-8.1.10.v20130312.jar file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!