Thursday, November 04, 2004

XHTML, CSS, JRun, Apache, and mime types

For one of our consulting clients, we have a site hosted by einsof, who use JRun integrated with Apache 1.3.27 on Linux. We've started doing XHTML JSP templates, and discovered that Mozilla-flavored browsers (including mozilla, firefox, and the Netscape/AOL browser all seem to require that CSS style sheets be sent by the web server with mime type text/css. A little googling turned up a number of discussions of this fact, for instance here and here.

Einsof made the appropriate changes to the Apache mime.types file, but the css files were still being sent as text/plain rather than text/css. Turns out that since they're using JRun 3.x as a servlet engine, a change to the JRun configuration was also required. The change was to add a line to the /usr/local/JRun/lib/global.properties file, like this:

webapp.mime-mapping.css=text/css

Once that change was made and JRun bounced, the style sheets got the correct text/css mime type, and everyone was happy.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home