Sha256: 2d587071d12d5e7e01bfcc758e073fd28d447e4d97cae35fd6a2686d6a293a43
Contents?: true
Size: 1.65 KB
Versions: 4
Compression:
Stored size: 1.65 KB
Contents
package org.dojotoolkit; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /* ------------------------------------------------------------ */ public class DojoFilter implements Filter { private ServletContext _context; private String _cacheControl="public, max-age=2419200"; /* ------------------------------------------------------------ */ /* * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) */ public void init(FilterConfig filterConfig) throws ServletException { _context= filterConfig.getServletContext(); String tmp = _context.getInitParameter("cacheControl"); if (tmp!=null) _cacheControl=tmp; } /* ------------------------------------------------------------ */ /* * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { ((HttpServletResponse)response).setHeader("Cache-Control",_cacheControl); chain.doFilter(request, response); } /* ------------------------------------------------------------ */ /* * @see javax.servlet.Filter#destroy() */ public void destroy() { } }
Version data entries
4 entries across 4 versions & 1 rubygems