Servlet Content Type

Advertisements

Prev Tutorial Next Tutorial

Content Type in Servlet

Content Type is also known as MIME Type. MIME stand for Multipurpose internet Mail Extension. It is a HTTP header that provides the description about what are you sending to the browser (like send image, text, video etc.).

This is the format of http protocol to carry the response contains to the client..

Example: Suppose you send html text based file as a response to the client the MIME type specification is

Syntax

response.setcontentType("text/html");

MIME type have two parts, They are:

  • Base name
  • Extension name

Base name: It is the generic name of file.

Extension name: It is extension name for specific file type.

The supporting MIME type by http protocol are:

FileMIME TypeExtension
xmltext/xml..xml.
HTMLtext/html..html.
Plaintext Filetext/plain..txt.
PDFapplication/pdf..pdf.
gif Imageimage/gif..gif.
JPEG Imageimage/jpeg..jpeg.
PNG Imageimage/x-png..png.
MP3 Music Fileaudio/mpeg..mp3.
MS Word Documentapplication/msword..doc.
Excel work sheetapplication/vnd.ms-sheet..xls.
Power Point Documentapplication/vnd.ms-powerpoint..ppt.

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements