Friday, May 29, 2015

WebLogic mime mappings

To configure mime-mappings in WebLogic, you have 2 ways.
One is to configure the whole domain, with a file.
This is the entry in config.xml (you can do it in console, domain, webapplications):


Mime Mapping File 

Returns the name of the file containing mime-mappings for the domain.

Format of the file should be: extension=mime-type


If this file does not exist, WebLogic Server uses an implicit mime-mapping set of mappings defined in weblogic.utils.http.HttpConstants (DEFAULT_MIME_MAPPINGS). To remove a mapping defined in implicit map just set it to blank.

MBean Attribute:

The other way is to create a mime-mapping entry in your web application's web.xml

For a general presentation of IE11 and Mime:

Remember also the default-mime-type attribute in weblogic.xml. "This element allows the user to specify the default mime type for a content-type for which the extension is not mapped."


Michael said...

Thanks for the helpful post. I used the web.xml approach, since I was more confident that I knew what I was doing there, but I hadn't thought of editing the file until you suggested it. Just in case someone else down the road needs a concrete example, here are the mappings I added to our web.xml file:


Michael said...

... and we needed additional mappings for jpeg, gif and png extensions. (All necessitated for IE and Chrome after we added X-Content-Type-Options: nosniff header).