Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JWebPlus:Question ID :1000038887460

 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question ID :1000038887460
You have to send a gif image to the client as a response to a request. How will you acquire the 'out' variable to do this?
ANS: ServletOutputStream out =res.getOutputStream()
Why not PrintWriter out = res.getWriter() ?
Bye.
Viki.
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PrintWriter would be for sending text, ServletOutputStream is for sending binary data. Your gif file is binary data.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic