Community
Participate
Working Groups
The Snaps style sample (org.eclipse.virgo.snaps.sample.blue) is a good example. When running the sample, the resource http://localhost:8080/animal-menu-bar/styles/main.css is sent down with no Content-Type header. Chrome gives a warning in its console: "Resource interpreted as Stylesheet but transferred with MIME type text/plain" (text/plain must be the fallback, in reality there was no MIME type specified). Along these same lines, StaticResourceServlet does not send text files using the Servlet's Writer, but always transfers the files as binary. Combined with the fact that no character encoding is specified in the headers, the client has to guess at the encoding. Tomcat has sane mime-mapping defaults for its static resource servlet. It knows to map "js" to "application/javascript", "css" to "text/css", etc. But this isn't just a question of defaults. Adding explicit mime-mapping elements to the Snap's web.xml has no effect; these configurations are completely ignored by Snaps.