File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring forum!
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( )