File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

cannot call getOutputStream() after getWriter()

sreedhar somi

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();

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

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.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: cannot call getOutputStream() after getWriter()
It's not a secret anymore!