Getting Exception-java.lang.IllegalStateException: getOutputStream() has already been called for this response

后端 未结 3 1271
独厮守ぢ
独厮守ぢ 2020-12-22 09:41

I am new to jsp,when I try to invoke a jsp page by some parameters named cId and passWord,I getting this error,The code I have been trying is given below,I have already gone

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-22 10:12

    You shouldn't try and do this inside a JSP. The JSP will already have obtained an output stream to write it's output. You need to use a servlet to return your XML.

    When you call response.getOutputStream, it is conflicting with the fact that the JSP (which will be compiled into a servlet) already obtained an output stream. This is why it is resulting in the IllegalStateException.

提交回复
热议问题