This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I read here that content-type's default for servlets is text/plain.
Is that correct? I'm using firebug to see the response header. I didn't set any content-type in my servlet. I got this response header in firebug:
Date Sun, 07 Mar 2010 17:13:04 GMT
Browsers maintain a map of how to deal with MIME types of the content sent to them. If they need to guess, they'll probably use a number of techniques to determine the MIME type, the most visible of which will be examining the URL for file types. It's a safe bet that all browsers will deal with content whose URL.s end with .html or .txt correctly.
In a servlet environment where URLs are mappings rather than references to physical files with file types, most browsers will simply assume a universal default of text/html.