com.interface21.web.servlet.mvc
Class WebContentGenerator

java.lang.Object
  |
  +--com.interface21.context.support.ApplicationObjectSupport
        |
        +--com.interface21.web.servlet.mvc.WebContentGenerator
All Implemented Interfaces:
ApplicationContextAware
Direct Known Subclasses:
AbstractController, MultiActionController

public class WebContentGenerator
extends ApplicationObjectSupport

Convenient superclass for any kind of web content generator, like AbstractController and MultiActionController. Supports HTTP cache control options.

Author:
Rod Johnson

Fields inherited from class com.interface21.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
WebContentGenerator()
           
 
Method Summary
protected  void cacheForSeconds(javax.servlet.http.HttpServletResponse response, int seconds, boolean mustRevalidate)
          Set HTTP headers to allow caching for the given number of seconds.
protected  void preventCaching(javax.servlet.http.HttpServletResponse response)
          Prevent the response being cached.
 void setUseExpiresHeader(boolean useExpiresHeader)
           
 
Methods inherited from class com.interface21.context.support.ApplicationObjectSupport
getApplicationContext, initApplicationContext, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebContentGenerator

public WebContentGenerator()
Method Detail

setUseExpiresHeader

public final void setUseExpiresHeader(boolean useExpiresHeader)

preventCaching

protected final void preventCaching(javax.servlet.http.HttpServletResponse response)
Prevent the response being cached. See www.mnot.net.cache docs.

cacheForSeconds

protected final void cacheForSeconds(javax.servlet.http.HttpServletResponse response,
                                     int seconds,
                                     boolean mustRevalidate)
Set HTTP headers to allow caching for the given number of seconds.
Parameters:
response - HTTP response
seconds - number of seconds into the future that the response should be cacheable for


Rod Johnson and Spring contributors 2001-2003.