|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.constructs.web.ResponseUtil
public final class ResponseUtil
A collection of response processing utilities, which are shared between 2 or more filters
Method Summary | |
---|---|
static void |
addGzipHeader(javax.servlet.http.HttpServletResponse response)
Adds the gzip HTTP header to the response. |
static boolean |
shouldBodyBeZero(javax.servlet.http.HttpServletRequest request,
int responseStatus)
Performs a number of checks to ensure response saneness according to the rules of RFC2616: If the response code is HttpServletResponse.SC_NO_CONTENT then it is illegal for the body
to contain anything. |
static boolean |
shouldGzippedBodyBeZero(byte[] compressedBytes,
javax.servlet.http.HttpServletRequest request)
Checks whether a gzipped body is actually empty and should just be zero. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean shouldGzippedBodyBeZero(byte[] compressedBytes, javax.servlet.http.HttpServletRequest request)
EMPTY_GZIPPED_CONTENT_SIZE
it should be zero.
compressedBytes
- the gzipped response bodyrequest
- the client HTTP request
public static boolean shouldBodyBeZero(javax.servlet.http.HttpServletRequest request, int responseStatus)
HttpServletResponse.SC_NO_CONTENT
then it is illegal for the body
to contain anything. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5
HttpServletResponse.SC_NOT_MODIFIED
then it is illegal for the body
to contain anything. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5
request
- the client HTTP requestresponseStatus
- the responseStatus
public static void addGzipHeader(javax.servlet.http.HttpServletResponse response) throws ResponseHeadersNotModifiableException
response
- the response which will have a header added to it. I.e this method changes its parameter
ResponseHeadersNotModifiableException
- Either the response is committed or we were called using the include method
from a RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
method and the set set header is ignored.
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |