| org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.support.WebContentGenerator
All known Subclasses: org.springframework.web.servlet.mvc.WebContentInterceptor, org.springframework.web.servlet.mvc.AbstractController,
Method Summary | |
final protected void | applyCacheSeconds(HttpServletResponse response, int seconds) Apply the given cache seconds and generate corresponding HTTP headers,
i.e. | final protected void | applyCacheSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate) Apply the given cache seconds and generate respective HTTP headers.
That is, allow caching for the given number of seconds in the
case of a positive value, prevent caching if given a 0 value, else
do nothing (i.e. | final protected void | cacheForSeconds(HttpServletResponse response, int seconds) Set HTTP headers to allow caching for the given number of seconds. | final protected void | cacheForSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate) Set HTTP headers to allow caching for the given number of seconds. | final protected void | checkAndPrepare(HttpServletRequest request, HttpServletResponse response, boolean lastModified) Check and prepare the given request and response according to the settings
of this generator. | final protected void | checkAndPrepare(HttpServletRequest request, HttpServletResponse response, int cacheSeconds, boolean lastModified) Check and prepare the given request and response according to the settings
of this generator. | final public int | getCacheSeconds() Return the number of seconds that content is cached. | final public String[] | getSupportedMethods() Return the HTTP methods that this content generator supports. | final public boolean | isRequireSession() Return whether a session is required to handle requests. | final public boolean | isUseCacheControlHeader() Return whether the HTTP 1.1 cache-control header is used. | final public boolean | isUseExpiresHeader() Return whether the HTTP 1.0 expires header is used. | final protected void | preventCaching(HttpServletResponse response) Prevent the response from being cached. | final public void | setCacheSeconds(int seconds) Cache content for the given number of seconds. | final public void | setRequireSession(boolean requireSession) Set whether a session should be required to handle requests. | final public void | setSupportedMethods(String[] methods) Set the HTTP methods that this content generator should support. | final public void | setUseCacheControlHeader(boolean useCacheControlHeader) Set whether to use the HTTP 1.1 cache-control header. | final public void | setUseExpiresHeader(boolean useExpiresHeader) Set whether to use the HTTP 1.0 expires header. |
METHOD_GET | final public static String METHOD_GET(Code) | | HTTP method "GET"
|
METHOD_HEAD | final public static String METHOD_HEAD(Code) | | HTTP method "HEAD"
|
METHOD_POST | final public static String METHOD_POST(Code) | | HTTP method "POST"
|
WebContentGenerator | public WebContentGenerator()(Code) | | |
applyCacheSeconds | final protected void applyCacheSeconds(HttpServletResponse response, int seconds)(Code) | | Apply the given cache seconds and generate corresponding HTTP headers,
i.e. allow caching for the given number of seconds in case of a positive
value, prevent caching if given a 0 value, do nothing else.
Does not tell the browser to revalidate the resource.
Parameters: response - current HTTP response Parameters: seconds - positive number of seconds into the future that theresponse should be cacheable for, 0 to prevent caching See Also: WebContentGenerator.cacheForSeconds(javax.servlet.http.HttpServletResponse,int,boolean) |
applyCacheSeconds | final protected void applyCacheSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate)(Code) | | Apply the given cache seconds and generate respective HTTP headers.
That is, allow caching for the given number of seconds in the
case of a positive value, prevent caching if given a 0 value, else
do nothing (i.e. leave caching to the client).
Parameters: response - the current HTTP response Parameters: seconds - the (positive) number of seconds into the future thatthe response should be cacheable for; 0 to prevent caching; anda negative value to leave caching to the client. Parameters: mustRevalidate - whether the client should revalidate the resource(typically only necessary for controllers with last-modified support) |
cacheForSeconds | final protected void cacheForSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate)(Code) | | Set HTTP headers to allow caching for the given number of seconds.
Tells the browser to revalidate the resource if mustRevalidate is
true .
Parameters: response - the current HTTP response Parameters: seconds - number of seconds into the future that the responseshould be cacheable for Parameters: mustRevalidate - whether the client should revalidate the resource(typically only necessary for controllers with last-modified support) |
checkAndPrepare | final protected void checkAndPrepare(HttpServletRequest request, HttpServletResponse response, boolean lastModified) throws ServletException(Code) | | Check and prepare the given request and response according to the settings
of this generator. Checks for supported methods and a required session,
and applies the number of cache seconds specified for this generator.
Parameters: request - current HTTP request Parameters: response - current HTTP response Parameters: lastModified - if the mapped handler provides Last-Modified support throws: ServletException - if the request cannot be handled because a check failed |
checkAndPrepare | final protected void checkAndPrepare(HttpServletRequest request, HttpServletResponse response, int cacheSeconds, boolean lastModified) throws ServletException(Code) | | Check and prepare the given request and response according to the settings
of this generator. Checks for supported methods and a required session,
and applies the given number of cache seconds.
Parameters: request - current HTTP request Parameters: response - current HTTP response Parameters: cacheSeconds - positive number of seconds into the future that theresponse should be cacheable for, 0 to prevent caching Parameters: lastModified - if the mapped handler provides Last-Modified support throws: ServletException - if the request cannot be handled because a check failed |
getCacheSeconds | final public int getCacheSeconds()(Code) | | Return the number of seconds that content is cached.
|
getSupportedMethods | final public String[] getSupportedMethods()(Code) | | Return the HTTP methods that this content generator supports.
|
isRequireSession | final public boolean isRequireSession()(Code) | | Return whether a session is required to handle requests.
|
isUseCacheControlHeader | final public boolean isUseCacheControlHeader()(Code) | | Return whether the HTTP 1.1 cache-control header is used.
|
isUseExpiresHeader | final public boolean isUseExpiresHeader()(Code) | | Return whether the HTTP 1.0 expires header is used.
|
preventCaching | final protected void preventCaching(HttpServletResponse response)(Code) | | Prevent the response from being cached.
See www.mnot.net.cache docs.
|
setCacheSeconds | final public void setCacheSeconds(int seconds)(Code) | | Cache content for the given number of seconds. Default is -1,
indicating no generation of cache-related headers.
Only if this is set to 0 (no cache) or a positive value (cache for
this many seconds) will this class generate cache headers.
The headers can be overwritten by subclasses, before content is generated.
|
setRequireSession | final public void setRequireSession(boolean requireSession)(Code) | | Set whether a session should be required to handle requests.
|
setSupportedMethods | final public void setSupportedMethods(String[] methods)(Code) | | Set the HTTP methods that this content generator should support.
Default is HEAD, GET and POST.
|
setUseCacheControlHeader | final public void setUseCacheControlHeader(boolean useCacheControlHeader)(Code) | | Set whether to use the HTTP 1.1 cache-control header. Default is "true".
Note: Cache headers will only get applied if caching is enabled
for the current request.
|
setUseExpiresHeader | final public void setUseExpiresHeader(boolean useExpiresHeader)(Code) | | Set whether to use the HTTP 1.0 expires header. Default is "true".
Note: Cache headers will only get applied if caching is enabled
for the current request.
|
|
|