Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.dropwizard.servlets;
 
 
 import javax.servlet.*;
Adds a no-cache header to all responses.
public class CacheBustingFilter implements Filter {
    private static final String CACHE_SETTINGS = "must-revalidate,no-cache,no-store";
    @Override
    public void doFilter(ServletRequest request,
                         ServletResponse response,
                         FilterChain chainthrows IOExceptionServletException {
        if (response instanceof HttpServletResponse) {
            final HttpServletResponse resp = (HttpServletResponseresponse;
            resp.setHeader(.);
        }
        chain.doFilter(requestresponse);
    }
    @Override
    public void destroy() { /* unused */ }
    @Override
    public void init(FilterConfig filterConfigthrows ServletException { /* unused */ }
New to GrepCode? Check out our FAQ X