code: public boolean checkGet(HttpServletRequest request, HttpServletResponse response)
              throws IOException, ServletException {
          if (!request.getMethod().equals("GET")) {
              response.sendError(405);  // 405 - Incorrect method.
              return false;
          }
  
          return true;
      }
docs: -------------------------------------------------------------------------------------------