code: protected void doRequest (HttpServletRequest request, HttpServletResponse response)
           throws ServletException, IOException
      {
          InvocationContext context = null;
          try {
              context =  new InvocationContext(request, response);
              setContentType(request, response);
  
              Template template = handleRequest(request, response, context);
              if (template != null) {
                  mergeTemplate(template, context);
              }
  
          } catch (Exception e) {
              log.warning("doRequest failed", "uri", request.getRequestURI(), e);
              response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
          }
      }
docs: Handles all requests (by default).
  
  @param request HttpServletRequest object containing client request.
  @param response HttpServletResponse object for the response.