tags:

views:

2076

answers:

3

In my servlet

an exeception thrown as

org.apache.jasper.JasperException: java.lang.IllegalStateException: getOutputStream() has already been called for this response

help me to resolve this problem

thanks in advance

+2  A: 

This will happen if a call is made to ServletResponse.getWriter() when an OutputStream has already been created for the response. Only one of getWriter() or getOutputStream() can be used to write a response body, not both.

Take a look at the stack trace associated with the exception to see if this is the case. Then, if you are trying to write character data use (only) getWriter() or for a binary response use getOutputStream().

Andy
A: 

you can remove the return if you are using struts

yhjhoo
A: 

what if we're using jsp??

silver_planet