File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setContentType

 
Ramakrishnan Ponmudi
Ranch Hand
Posts: 72
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic