April 17th, 2003, 09:43 AM
IllegalStateException on response.getOutputStream()
I am using a JSP, which is used for html presentation & a servlet is called from this JSP, which invokes a response.getOutputStream() & this results in IllegalStateException being thrown. According to servlets specifications, servlet can support either of the JspWriter or OutputStream object. So it is illegal to call getOutputStream() method on the response object as 'out' object is already present in any JSP (internally there must be a call like response.getWriter() to fetch this 'out;' object).
Any solution for this? I want to use OutputStream object somehow or the other in a JSP.
I am using JRun4 app server. It follows the servlet specs strictly. However i have found some low end app servers like Resin, which do not follo servlet sepcifications strictly, being able to handle this senario. But I need to use JRun4. No other option.
Any solution anybody?
April 21st, 2003, 10:09 AM
I understand the problem, but I don't understand why it is a problem. Why do you need to get the outputstream in a servlet that is included by a jsp?