code: public static boolean checkSelector(SlingHttpServletRequest request, String key) {
          String[] selectors = request.getRequestPathInfo().getSelectors();
          for (String selector : selectors) {
              if (selector.equals(key)) {
                  return true;
              }
          }
          return false;
      }
docs: Retrieves a key in the selectors and returns 'true' is the key is present.
  
  @param request the request object with the selector info
  @param key     the selector key which is checked