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

后端 未结 2 1025
萌比男神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条回答
  • 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”.

    0 讨论(0)
  • 2021-01-22 20:19

    my problem was that i was forgetting to close the outputstream in some other place in the code that was not posted above.

    0 讨论(0)
提交回复
热议问题