code: @Override
      protected final void doGet(final HttpServletRequest request,
              final HttpServletResponse response) throws IOException {
  
          @SuppressWarnings("unchecked")
          /*-
           * As request.getParameterMap() in servlet-api-2.5 provides return type of raw java.util.Map,
           * we suppress the type safety check warning here.
           */
          Map<String, String[]> queryParams = (Map<String, String[]>) request
                  .getParameterMap();
          Map<String, String> headers = new HashMap<String, String>();
  
          // To make sure, No response data impacted by others subsequent and concurrent request.
          synchronized (this) {
               //Getting request headers to filter the region name.
               Enumeration headerNames = request.getHeaderNames();
               if (headerNames != null) {
                   while (headerNames.hasMoreElements()) {
                      String key = (String) headerNames.nextElement();
                      String value = request.getHeader(key);
                      headers.put(key, value);
                   }
               }
  
               response.setContentType("text/xml");
               response.setCharacterEncoding("UTF-8");
  
               MockEC2QueryHandler.getInstance().handle(queryParams, headers, response);
          }
      }
docs: Pass the query parameters from client to {@link MockEC2QueryHandler} and write response to client.
  
  @param request
  request from client of AWS doing the query
  @param response
  response that with an xml body describing the calling result of query from request
  @throws IOException
  throw an I/O exception in case of failing to get the httpServletResponse's writer