code: public void doFilter(ServletRequest request,
                           ServletResponse response,
                           FilterChain filterChain)
      throws IOException, ServletException {
          if (logger.isDebugEnabled()) {
              logger.debug("Entering FilterRestApiFlash.doThisSubclass()");
          }
  
          HttpServletRequest httpRequest = (HttpServletRequest)request;
          HttpServletResponse httpResponse = (HttpServletResponse)response;
          String queryString = httpRequest.getQueryString();
          if(queryString != null &&
             queryString.contains("flash=true")) {
              StatusHttpServletResponseWrapper sHttpResponse =
                  new StatusHttpServletResponseWrapper(httpResponse);
  
              filterChain.doFilter(request, sHttpResponse);
  
              if(sHttpResponse.status != sHttpResponse.realStatus) {
                  // Append the error indicator with real status
                  try {
                      ServletOutputStream out = sHttpResponse.getOutputStream();
                      out.print("::ERROR("+sHttpResponse.realStatus+")");
                  } catch(IllegalStateException ise) {
                      PrintWriter out = sHttpResponse.getWriter();
                      out.print("::ERROR("+sHttpResponse.realStatus+")");
                  }
              }
          } else {
              filterChain.doFilter(request, response);
          }
      }
docs: Perform flash client response filtering