java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
All Implemented Interfaces:
Controller, ServletContextAware, ApplicationContextAware
Direct Known Subclasses:
AbstractUrlViewController, AbstractWizardFormController, CancellableFormController, ParameterizableViewController, MultiActionController, BaseCommandController, SimpleFormController, AbstractClinicForm, ServletForwardingController, AbstractCommandController, AbstractFormController, UrlFilenameViewController, ServletWrappingController
Convenient superclass for controller implementations, using the Template Method design pattern.
As stated in the Controller interface, a lot of functionality is already provided by certain abstract base controllers. The AbstractController is one of the most important abstract base controller providing basic features such as the generation of caching headers and the enabling or disabling of supported methods (GET/POST).
Workflow
(and that defined by interface):
Exposed configuration properties
(and those defined by interface):
| name | default | description |
| supportedMethods | GET,POST | comma-separated (CSV) list of methods supported by this controller, such as GET, POST and PUT |
| requireSession | false | whether a session should be required for requests to be able to be handled by this controller. This ensures that derived controller can - without fear of null pointers - call request.getSession() to retrieve a session. If no session can be found while processing the request, a ServletException will be thrown |
| cacheSeconds | -1 | indicates the amount of seconds to include in the cache header for the response following on this request. 0 (zero) will include headers for no caching at all, -1 (the default) will not generate any headers and any positive number will generate headers that state the amount indicated as seconds to cache the content |
| synchronizeOnSession | false | whether the call to handleRequestInternal should be
synchronized around the HttpSession, to serialize invocations
from the same client. No effect if there is no HttpSession.
|
Rod - JohnsonJuergen - Hoeller| Fields inherited from org.springframework.web.servlet.support.WebContentGenerator: |
|---|
| METHOD_GET, METHOD_HEAD, METHOD_POST |
| Fields inherited from org.springframework.context.support.ApplicationObjectSupport: |
|---|
| logger |
| Method from org.springframework.web.servlet.mvc.AbstractController Summary: |
|---|
| handleRequest, handleRequestInternal, isSynchronizeOnSession, setSynchronizeOnSession |
| Methods from org.springframework.web.servlet.support.WebContentGenerator: |
|---|
| applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader |
| Methods from org.springframework.web.context.support.WebApplicationObjectSupport: |
|---|
| getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| Methods from org.springframework.context.support.ApplicationObjectSupport: |
|---|
| getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.web.servlet.mvc.AbstractController Detail: |
|---|
|
handleRequest. |
|
More specifically, the execution of the The session mutex is guaranteed to be the same object during
the entire lifetime of the session, available under the key defined
by the In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex. |