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

Version Path
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/util/maven/dojo-war/src/main/java/org/dojotoolkit/DojoFilter.java
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/util/maven/dojo-war/src/main/java/org/dojotoolkit/DojoFilter.java
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/util/maven/dojo-war/src/main/java/org/dojotoolkit/DojoFilter.java
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/util/maven/dojo-war/src/main/java/org/dojotoolkit/DojoFilter.java