• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setContentType

 
Ramakrishnan Ponmudi
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it mandatory to call setContentType before calling getWriter() or getOutputStream on response object if content type is other than "text/html". If i am not setting it, can i get any errors?
 
Hendy Setyo Mulyo
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There will no be error in the server. But you will not get the desired result when it displayed in the client (browser) (It will display characters in the browser). It because the browser will always assume you want to display text/html.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic