This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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
Bookmark "cannot call getoutputstream( ) after getwriter( )" Watch "cannot call getoutputstream( ) after getwriter( )" New topic

cannot call getoutputstream( ) after getwriter( )

sreedhar somi

Joined: Jun 27, 2006
Posts: 2
I am using poi api for generating excel sheets.iam creating workbook and sheets in my code.for writing the output iam using outputstream().
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

Joined: Dec 11, 2004
Posts: 13410

Yes, call one or the other.
The HTTP protocol allows one response per request.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
GeeCON Prague 2014
subject: cannot call getoutputstream( ) after getwriter( )