When does response.getWriter (). Write write data to the browser?

when does response.getWriter (). Write write data to the browser?

    @RequestMapping("/testOutStream")
    public void testOutStream(HttpServletResponse response) throws IOException, InterruptedException {
        response.getWriter().println("test1");
        Thread.sleep(5000);
    }

doesn"t response.getWriter (). Write write data to the browser after being called? When the method is finished? I don"t know how it works inside.
ask the boss to help me with the answer.

The

method completes writing data, or else it will be written many times with one request, calling a write, in this place and calling a write in that place

.
Menu