Defining MIME Types

Each HandlerContext  has a MIME type mapping. Default MIME types are set in the org/mortbay/http/mime.properties file within the org.mortbay.jetty.jar file.

For WebApplicationContexts, additional MIME type mappings can be added in the web.xml file:

  <mime-mapping> 
    <extension>wml</extension>
    <mime-type>text/vnd.wap.wml</mime-type>
  </mime-mapping>

To configure the MIME mapping from a jetty.xml file:

<Call name="addContext">
  ...
  <Call name="setMimeMapping >
    <Arg>ext</Arg>
    <Arg>your/type</Arg>
  </Call>
  ...

Return to JettyConfiguration.