• Post Reply Bookmark Topic Watch Topic
  • New Topic

setContentType(),

 
agrah upadhyay
Ranch Hand
Posts: 579
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i don't invoke setContentType(),will there be any default value for content type?
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No there is NO default value for ContentType.

You got to set the ContentType as the first thing in your servlet code.
 
agrah upadhyay
Ranch Hand
Posts: 579
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yaa that i wanted to confirm because there are many codes in some books without settting content type...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as JSP is concerned,

The initial response content type is set to the TYPE value of the contentType
attribute of the page directive. If the page doesn�t provide this attribute, the initial content type is �text/html� for JSP pages in standard syntax and �text/xml� for JSP documents in XML syntax.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!