@Deprecated public abstract class AbstractCommandController extends BaseCommandController
Autopopulates a command bean from the request. For command validation,
a validator (property inherited from BaseCommandController
) can be
used.
In most cases this command controller should not be used to handle form
submission, because functionality for forms is offered in more detail by the
AbstractFormController
and its
corresponding implementations.
Exposed configuration properties
(and those defined by superclass):
none (so only those available in superclass).
BaseCommandController.setCommandClass(java.lang.Class)
,
BaseCommandController.setCommandName(java.lang.String)
,
BaseCommandController.setValidator(org.springframework.validation.Validator)
DEFAULT_COMMAND_NAME
METHOD_GET, METHOD_HEAD, METHOD_POST
logger
Constructor and Description |
---|
AbstractCommandController()
Deprecated.
Create a new AbstractCommandController.
|
AbstractCommandController(Class commandClass)
Deprecated.
Create a new AbstractCommandController.
|
AbstractCommandController(Class commandClass,
String commandName)
Deprecated.
Create a new AbstractCommandController.
|
Modifier and Type | Method and Description |
---|---|
protected abstract ModelAndView |
handle(HttpServletRequest request,
HttpServletResponse response,
Object command,
BindException errors)
Deprecated.
Template method for request handling, providing a populated and validated instance
of the command class, and an Errors object containing binding and validation errors.
|
protected ModelAndView |
handleRequestInternal(HttpServletRequest request,
HttpServletResponse response)
Deprecated.
Template method.
|
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommand, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, suppressValidation, useDirectFieldAccess
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
public AbstractCommandController()
public AbstractCommandController(Class commandClass)
commandClass
- class of the command beanprotected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception
AbstractController
handleRequest
.handleRequestInternal
in class AbstractController
Exception
AbstractController.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
protected abstract ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception
Call errors.getModel()
to populate the ModelAndView model
with the command and the Errors instance, under the specified command name,
as expected by the "spring:bind" tag.
request
- current HTTP requestresponse
- current HTTP responsecommand
- the populated command objecterrors
- validation errors holdernull
if handled directlyException
Errors
,
BindException.getModel()