|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.portlet.context.PortletApplicationObjectSupport org.springframework.web.portlet.handler.PortletContentGenerator
public abstract class PortletContentGenerator
Convenient superclass for any kind of web content generator, like AbstractController. Can also be used for custom handlers that have their own HandlerAdapter.
Supports portlet cache control options.
AbstractController
Field Summary |
---|
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
PortletContentGenerator()
|
Method Summary | |
---|---|
protected void |
applyCacheSeconds(RenderResponse response,
int seconds)
Apply the given cache seconds to the render response |
protected void |
cacheForSeconds(RenderResponse response,
int seconds)
Set portlet response to allow caching for the given number of seconds. |
protected void |
check(PortletRequest request,
PortletResponse response)
Check and prepare the given request and response according to the settings of this generator. |
protected void |
checkAndPrepare(RenderRequest request,
RenderResponse response)
Check and prepare the given request and response according to the settings of this generator. |
protected void |
checkAndPrepare(RenderRequest request,
RenderResponse response,
int cacheSeconds)
Check and prepare the given request and response according to the settings of this generator. |
int |
getCacheSeconds()
Return the number of seconds that content is cached. |
boolean |
isRequireSession()
Return whether a session is required to handle requests. |
protected void |
preventCaching(RenderResponse response)
Prevent the render response from being cached. |
void |
setCacheSeconds(int seconds)
Cache content for the given number of seconds. |
void |
setRequireSession(boolean requireSession)
Set whether a session should be required to handle requests. |
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport |
---|
getPortletContext, getTempDir, isContextRequired, setPortletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PortletContentGenerator()
Method Detail |
---|
public final void setRequireSession(boolean requireSession)
public final boolean isRequireSession()
public final void setCacheSeconds(int seconds)
Only if this is set to 0 (no cache) or a positive value (cache for this many seconds) will this class override the portlet settings.
The cache setting can be overwritten by subclasses, before content is generated.
public final int getCacheSeconds()
protected final void check(PortletRequest request, PortletResponse response) throws PortletException
request
- current portlet requestresponse
- current portlet response
PortletException
- if the request cannot be handled because a check failedprotected final void checkAndPrepare(RenderRequest request, RenderResponse response) throws PortletException
request
- current portlet requestresponse
- current portlet response
PortletException
- if the request cannot be handled because a check failedprotected final void checkAndPrepare(RenderRequest request, RenderResponse response, int cacheSeconds) throws PortletException
request
- current portlet requestresponse
- current portlet responsecacheSeconds
- positive number of seconds into the future that the
response should be cacheable for, 0 to prevent caching
PortletException
- if the request cannot be handled because a check failedprotected final void preventCaching(RenderResponse response)
protected final void cacheForSeconds(RenderResponse response, int seconds)
response
- current portlet render responseseconds
- number of seconds into the future that the response
should be cacheable forprotected final void applyCacheSeconds(RenderResponse response, int seconds)
response
- current portlet render responseseconds
- positive number of seconds into the future that the
response should be cacheable for, 0 to prevent caching
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |