#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    1
    Rep Power
    0

    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?

    Jaideep
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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?

IMN logo majestic logo threadwatch logo seochat tools logo