wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
 
subject: cannot call getoutputstream( ) after getwriter( )
 
Similar Threads
probelms with response.getOutputStream
getWriter()
cannot call getOutputStream() after getWriter()
setContentType and getOutputStream
Good question