系统资源,js、图片缓存,提高系统运行速度
1、在web.xml配置
/** * * @author xutianlong * @version [版本号, Sep 11, 2012] * @see [相关类/方法] * @since [产品/模块版本] */public class ResponseHeaderFilter implements Filter{ private FilterConfig fc; public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletResponse response = (HttpServletResponse) res; for (Enumeration e = this.fc.getInitParameterNames(); e.hasMoreElements();) { String headerName = (String) e.nextElement(); response.addHeader(headerName, this.fc.getInitParameter(headerName)); } chain.doFilter(req, response); } public void init(FilterConfig filterConfig) { this.fc = filterConfig; } public void destroy() { this.fc = null; }}