code: public static boolean isJsonRequest(ServletRequest request) {
  
          HttpServletRequest sr = (HttpServletRequest)request;
          return (sr.getQueryString() != null) && (sr.getQueryString().contains("__json=true"));
      }
docs: Detects whether the filter needs to be used for the given request.<p>
  
  @param request the request
  @return true if the filter should be used for the request