public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)  throws IOException, ServletException {

        if (response instanceof HttpServletResponse && request instanceof HttpServletRequest) {
            HttpServletRequest httpRequest = (HttpServletRequest) request;
            if (httpRequest.getRequestURI().startsWith("/static")) {
                filterChain.doFilter(request, response);
                return;
            }

            // do something here

            filterChain.doFilter(request, response);
        } else {
            LOG.warning("Unexpected non HTTP servlet response. Proceeding anyway.");
            filterChain.doFilter(request, response);
        }
    }