aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes contentType  vs  mimeType Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "contentType  vs  mimeType" Watch "contentType  vs  mimeType" New topic
Author

contentType vs mimeType

MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Hi...

What is the difference between

<%@ page contentType="text/html"%>
<%@ page mimeType="text/html"%>

Thanks


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Colin Fletcher
Ranch Hand

Joined: Sep 10, 2004
Posts: 200
Mime types are definitions of what kind of file. The content type uses mime types to tell the browser what to expect.

eg.

Mime Type: application/x-pdf = PDF File
Mime Type: text/plain = plain text file (no html formatting)
Mime Type: text/html = text file with html formatting..

Hope this helps.


SCJP 1.4 SCWCD 1.4
Jose Esteban
Ranch Hand

Joined: Nov 28, 2004
Posts: 102
Originally posted by minu su:
What is the difference between

<%@ page contentType="text/html"%>
<%@ page mimeType="text/html"%>


The main difference is that the second one is incorrect since mimeType is not an attribute of the page directive.

Besides, the contentType attribute defines the MIME type and the character encoding for the response of the JSP page.
 
 
subject: contentType vs mimeType