This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one 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
Author

cannot call getoutputstream( ) after getwriter( )

sreedhar somi
Greenhorn

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

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot call getoutputstream( ) after getwriter( )