Sun Java System Web Server 6.1 SP9 Administrator's Configuration File Reference

type-by-extension

Applicable in ObjectType-class directives.

The type-by-extension function instructs the server to look in a table of MIME type mappings to find the MIME type of the requested resource according to the extension of the requested resource. The MIME type is added to the Content-Type header sent back to the client.

The table of MIME type mappings is created by a MIME element in the server.xml file, which loads a MIME types file or list and creates the mappings. For more information about server.xml and MIME types files, see the Sun Java System Web Server 6.1 SP9 Administrator’s Configuration File Reference.

For example, the following two lines are part of a MIME types file:


type=text/html    exts=htm,htmltype=text/plain    exts=txt

         

If the extension of the requested resource is htm or html, the type-by-extension file sets the type to text/html. If the extension is .txt, the function sets the type to text/plain.

Parameters

The following table describes parameters for the type-by-extension function.

Table 4–38 type-by-extension Parameters

Parameter  

Description  

bucket

(Optional) Common to all obj.conf functions.

Example


ObjectType fn=type-by-extension

         

See Also

type-by-exp, force-type