@Deprecated public abstract class AbstractCommandController extends BaseCommandController
Abstract base class for custom command controllers. Autopopulates a command bean from the request. For command validation, a validator (property inherited from BaseCommandController) can be used.
This command controller should preferrable not be used to handle form
submission, because functionality for forms is more 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
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 String |
getCommandInSessionParameterName()
Deprecated.
Return the name of the render parameter that indicates there
is a valid command (and errors) object in the session.
|
protected abstract void |
handleAction(ActionRequest request,
ActionResponse 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 void |
handleActionRequestInternal(ActionRequest request,
ActionResponse response)
Deprecated.
Subclasses are meant to override this method if the controller
is expected to handle action requests.
|
protected abstract ModelAndView |
handleRender(RenderRequest request,
RenderResponse response,
Object command,
BindException errors)
Deprecated.
Template method for render request handling, providing a populated and validated instance
of the command class, and an Errors object containing binding and validation errors.
|
protected ModelAndView |
handleRenderRequestInternal(RenderRequest request,
RenderResponse response)
Deprecated.
Subclasses are meant to override this method if the controller
is expected to handle render requests.
|
protected boolean |
isCommandInSession(RenderRequest request)
Deprecated.
Determine if there is a valid command (and errors) object in the
session for this render request.
|
protected void |
setCommandInSession(ActionResponse response)
Deprecated.
Set the action response parameter that indicates there is a
command (and errors) object in the session for the render phase.
|
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommand, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getRenderCommand, getRenderCommandSessionAttributeName, getRenderErrors, getRenderErrorsSessionAttributeName, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setRenderCommandAndErrors, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, useDirectFieldAccess
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
getPortletContext, getTempDir, isContextRequired, setPortletContext
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
public AbstractCommandController()
public AbstractCommandController(Class commandClass)
commandClass
- class of the command beanprotected final void handleActionRequestInternal(ActionRequest request, ActionResponse response) throws Exception
AbstractController
handleActionRequest
.
The default implementation throws a PortletException.
protected final ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception
AbstractController
handleRenderRequest
.
The default implementation throws a PortletException.
protected abstract void handleAction(ActionRequest request, ActionResponse 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 action requestresponse
- current action responsecommand
- the populated command objecterrors
- validation errors holderException
Errors
,
BindException.getModel()
protected abstract ModelAndView handleRender(RenderRequest request, RenderResponse 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 render requestresponse
- current render responsecommand
- the populated command objecterrors
- validation errors holderException
Errors
,
BindException.getModel()
protected String getCommandInSessionParameterName()
PortletRequest.getParameter(java.lang.String)
protected final void setCommandInSession(ActionResponse response)
response
- the current action responsegetCommandInSessionParameterName()
,
isCommandInSession(javax.portlet.RenderRequest)
protected boolean isCommandInSession(RenderRequest request)
request
- current render requestgetCommandInSessionParameterName()
,
setCommandInSession(javax.portlet.ActionResponse)