• 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.
 
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!