Does a servlets PrintWriter out stream really need to be closed?

后端 未结 1 1023
旧时难觅i
旧时难觅i 2021-02-07 15:59

I wrote a simple servlet as follows:

public class MyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)         


        
1条回答
  •  深忆病人
    2021-02-07 16:18

    If it's not you that's opening the stream, you should not close it.

    The stream is opened by the container so the responsibility for closing lies with it.

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