• Post Reply Bookmark Topic Watch Topic
  • New Topic

OutputStream already obtained  RSS feed

 
chandra reddy pandillapalle
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while reading file content into jsp.please let me know the solution
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When writing a servlet response, you can obtain either the Writer or the OutputStream. Never both. If you try, or if something happens to cause this to happen, you get an exception.

One common cause of this error is when you are writing binary output (to the OutputStream) and an exception causes it to redirect to the error page. The error page tries to write to the Writer, causing a second exception which can sometimes hide the first problem.

Without more infor it is a bit hard to say.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another cause is that JSP, by nature writes character data to a printWriter.
This is why JSP is a poor choice for streaming binary data to a client.

Use a servlet instead and you will have a much simpler interface that gives you a lot more control over the output.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!