public class GzipFilter extends java.lang.Object implements Filter
Constructor and Description |
---|
GzipFilter() |
Modifier and Type | Method and Description |
---|---|
void |
addAllowContentType(java.lang.String type)
Adds an allowed content type.
|
void |
addDenyContentType(java.lang.String type)
Adds a deny content type.
|
protected void |
addVaryHeader(HttpServletResponse response) |
protected int |
allowGzip(HttpServletRequest req,
HttpServletResponse res)
Returns true if the GZip is allowed.
|
void |
destroy()
Any cleanup for the filter.
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain nextFilter)
Creates a wrapper to compress the output.
|
void |
init(FilterConfig config)
Initialize the filter.
|
void |
setEmbedErrorInOutput(boolean embedError)
Set true if errors should be embedded in the output.
|
void |
setNoCache(boolean noCache)
Set true if the output should not be cached.
|
void |
setUseVary(boolean useVary)
Set true if the vary support should be enabled.
|
public void setUseVary(boolean useVary)
public void setNoCache(boolean noCache)
public void setEmbedErrorInOutput(boolean embedError)
public void addAllowContentType(java.lang.String type)
public void addDenyContentType(java.lang.String type)
public void init(FilterConfig config) throws ServletException
Filter
init
in interface Filter
ServletException
public void doFilter(ServletRequest request, ServletResponse response, FilterChain nextFilter) throws ServletException, java.io.IOException
doFilter
in interface Filter
request
- the servlet requestresponse
- the servlet responsenextFilter
- the next filter in the chainServletException
java.io.IOException
protected void addVaryHeader(HttpServletResponse response)
protected int allowGzip(HttpServletRequest req, HttpServletResponse res)