@ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { if ( response instanceof HttpServletResponse ) { HttpServletResponse httpResponse = ( HttpServletResponse ) response ; String queryString = ( ( HttpServletRequest ) request ) . getQueryString ( ) ; if ( queryString == null ) { queryString = "" ; } if ( regExpFilters == null || regExpFilters . isEmpty ( ) ) { setHeaders ( httpResponse ) ; } else { if ( Pattern . matches ( regExpFilters , queryString ) ) { setHeaders ( httpResponse ) ; } } } chain . doFilter ( request , response ) ; }
Add no - cache headers if Query String matches reqExoFilters