java.lang.IllegalStateException: getOutputStream() has already been called for this response in JSF 2

后端 未结 2 1028
萌比男神i
萌比男神i 2021-01-22 19:43

i have a legacy code that writes a jsp page in xml, and i am trying to convert it to JSF 2 but i am getting the following exception:

    Jul 10, 2012 11:34:57 AM         


        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-22 20:09

    This will happen if during the request processing both HttpServletResponse.getWriter() and HttpServletResponse.getOutputStream() are being called. And as per the spec, it is illegal to use both OutputStream and Writer.

    Check the code which is calling HttpServletResponse.getOutputStream() somewhere else in your code.

    Possible Duplicate of getting error “getOutputStream() has already been called for this response”.

提交回复
热议问题