Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot call getoutputstream( ) after getwriter( )

 
sreedhar somi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using poi api for generating excel sheets.iam creating workbook and sheets in my code.for writing the output iam using outputstream().
response.getoutputstream()
build and deployment successful. but when i ran the servlet on browser iam getting the following error.
cannot call getoutputstream() after getwriter()

is there any way to resolve this issue.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, call one or the other.
The HTTP protocol allows one response per request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic