Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes  cannot call getOutputStream() after getWriter() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

cannot call getOutputStream() after getWriter()

sreedhar somi
Greenhorn

Joined: Jun 27, 2006
Posts: 2
This is the line which throws the exception, and i didn't call
getWriter() at all before this.

OutputStream out = response.getOutputStream();
wb.write(out);
out.close();

I am using poi api(servlets) for generating excel sheets.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

sreedhar somi,

Don't start a new thread to continue a discussion.
Go to the original thread and click the "reply" button to add a new post.

http://www.coderanch.com/t/362882/Servlets/java/cannot-call-getoutputstream-after-getwriter


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
wood burning stoves
 
subject: cannot call getOutputStream() after getWriter()
 
Similar Threads
confused on SCWCD Kit's Errata on Page 41.
Doubt on RequestDispatcher
Create HttpResponse 's object
setContentType and getOutputStream
Good question