The multipurpose Internal mail extension system was developed to describe the type and format of a file. For example, a plain text file has the MIME type text/plain.
MIME types always consists of two parts: a major category(text file) and a sub-category (Plain). Other (non-plain) text files include text/rtf for rich text File and text/html for HTML web pages.
Other major MIME categories include images, music, and video; for example, image/jpeg and video/mpeg.
In general, the MIME type of a file is referenced against the extension of that file. The gif extension is associated with the image/gif MIME type by default.
HTTP can optionally use the content type response header to notify the client of the MIME type of the data being transmitted, in case the client is either not aware of the file extension being used, or the file format differs from the MIME type normally associated with that extension.
To configure a given MIME type against a given file extension for a Web application, we can use the deployment descriptor. The <extension> element specifies the file extension of the group of files to which we are applying the mapping (e.g. txt). The<mime-type> element declares the actual MIME type associated with that extension (e.g. text/plain).
However, Java EE server usually provides default mapping for all common file formats, and is usually required only if you want to map an extension to a MIME type which is not normally mapped.