• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

contentType vs mimeType

 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...

What is the difference between

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

Thanks
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic