in this case, the servlet associated with the url template (previously set) is invoked.
The method invoked depends on the type of request (doGet, doPost, doPut).
Typically, a method receives request and response objects, then the .getWriter () method is called to respond obj, which receives a stream to which we can write our output.
response.getWriter () returns a PrintWriter object that can send text to the client.
The call to flush () on PrintWriter is responsible for the response.
source share