读书人

系统资源js、图片缓存拔高系统运行

发布时间: 2013-01-28 11:49:56 作者: rapoo

系统资源,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;    }}



读书人网 >JavaScript

热点推荐