users@glassfish.java.net

Configure Glassfish Mime-Types

From: Joerg Gippert <jgippert_at_online.de>
Date: Sat, 15 Mar 2008 03:24:55 +0100

Hello,

I am trying to change a Mime-Type mapping on Glassfish but I cannot find any documentation on how to do that. I am using Glassfish V2 build b33. The problem I encouter is, that my webpage hosted on my glassfish server is not displayed properly with Firefox browsers. FF complains, that stylesheet I use in m JSP is of Mime-Type text/plain and not text/css. Which is true if I look at the header, Glassfish sends to the broswer:

GET /myWeb/faces/jsp/neu.css HTTP/1.1
Host: 127.0.0.1:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.5) Gecko/20041122 Firefox/1.0
Accept: text/css,*/*;q=0.1
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

HTTP/1.x 200 OK
X-Powered-By: Servlet/2.5, JSF/1.2
Server: Sun Java System Application Server 9.1
Content-Type: text/plain; charset=iso-8859-1 <-------------- should be text/css
Content-Length: 4709

This problem seems to only occuring with Firefox. It does not appear with Opera or IE. Can anybody tell me, how I can make Glassfish to send out the proper Mime-Type?

Thanks in advance.
Cheers,
Joerg