MIME Type

Problem

The browser does not show the Favicon of the web application, even it is stored in the root directory and the associate head tag is defined in the page.

Cause

The GlassFish MIME type list does not contain an entry for the file extension ico. Therefore the server sends the Favicon file with MIME type text/html back to the browser.

Solution

To solve this problem for all web applications just add the MIME type image/vnd.microsoft.icon in the file default-web.xml [2].

<mime-mapping> <extension>ico</extension> <mime-type>image/vnd.microsoft.icon</mime-type> </mime-mapping>

Resources

Author: Johannes HammoudComments Date: 29.08.2009

Language German

Java JSF XHTML WML JavaScript GlassFish MySQL NetBeans

Imprint

Visits
582379
Today
35