JSP page directive – contentType

 contentType attribute is used to set the mime type and character set of the JSP. The user can make use of any MIME type or character set valid for the JSP container.

Syntax of contentType attribute available for page directive is:

<%@ page contentType=”mimeType [; charset=characterSet]” %>

In the above statement, page and contentType are keywords. The default, MIMEtype is text/html, and the default character set is ISO-8859-1.

For example, the user specifies the attribute contentType is:

<%@ page contentType=”text/html;charset=ISO-8859-1″ %>

Leave a Reply

Your email address will not be published. Required fields are marked *