首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2013-01-28 
系统资源,js、图片缓存,提高系统运行速度1、在web.xml配置/** ** @author xutianlong * @version [版本号, S

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



热点排行
Bad Request.