| org.springframework.web.servlet.mvc.AbstractController org.springframework.web.servlet.mvc.BaseCommandController org.springframework.web.servlet.mvc.AbstractFormController org.springframework.web.servlet.mvc.SimpleFormController org.springframework.web.servlet.mvc.CancellableFormController
CancellableFormController | public class CancellableFormController extends SimpleFormController (Code) | | Extension of SimpleFormController that supports "cancellation"
of form processing. By default, this controller looks for a given parameter in the
request, identified by the cancelParamKey. If this parameter is present,
then the controller will return the configured cancelView , otherwise
processing is passed back to the superclass.
Workflow
(in addition to the superclass):
- Call to
CancellableFormController.processFormSubmission processFormSubmission which calls
CancellableFormController.isCancelRequest to see if the incoming request is to cancel the
current form entry. By default,
CancellableFormController.isCancelRequest returns
true
if the configured cancelParamKey exists in the request.
This behavior can be overridden in subclasses.
- If
CancellableFormController.isCancelRequest returns
false , then the controller
will delegate all processing back to
SimpleFormController SimpleFormController ,
otherwise it will call the
CancellableFormController.onCancel version with all parameters.
By default, that method will delegate to the
CancellableFormController.onCancel version with just
the command object, which will in turn simply return the configured
cancelView . This behavior can be overridden in subclasses.
Thanks to Erwin Bolwidt for submitting the original prototype
of such a cancellable form controller!
author: Rob Harrop author: Juergen Hoeller since: 1.2.3 See Also: CancellableFormController.setCancelParamKey See Also: CancellableFormController.setCancelView See Also: CancellableFormController.isCancelRequest(javax.servlet.http.HttpServletRequest) See Also: CancellableFormController.onCancel(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,Object) |
getCancelParamKey | final public String getCancelParamKey()(Code) | | Return the key of the request parameter used to identify a cancel request.
|
getCancelView | final public String getCancelView()(Code) | | Gets the name of the cancel view.
|
isCancelRequest | protected boolean isCancelRequest(HttpServletRequest request)(Code) | | Determine whether the incoming request is a request to cancel the
processing of the current form.
By default, this method returns true if a parameter
matching the configured cancelParamKey is present in
the request, otherwise it returns false . Subclasses may
override this method to provide custom logic to detect a cancel request.
The parameter is recognized both when sent as a plain parameter
("_cancel") or when triggered by an image button ("_cancel.x").
Parameters: request - current HTTP request See Also: CancellableFormController.setCancelParamKey See Also: CancellableFormController.PARAM_CANCEL |
setCancelParamKey | final public void setCancelParamKey(String cancelParamKey)(Code) | | Set the key of the request parameter used to identify a cancel request.
Default is "_cancel".
The parameter is recognized both when sent as a plain parameter
("_cancel") or when triggered by an image button ("_cancel.x").
|
setCancelView | final public void setCancelView(String cancelView)(Code) | | Sets the name of the cancel view.
|
Methods inherited from org.springframework.web.servlet.mvc.SimpleFormController | protected void doSubmitAction(Object command) throws Exception(Code)(Java Doc) final public String getFormView()(Code)(Java Doc) final public String getSuccessView()(Code)(Java Doc) protected boolean isFormChangeRequest(HttpServletRequest request, Object command)(Code)(Java Doc) protected boolean isFormChangeRequest(HttpServletRequest request)(Code)(Java Doc) protected void onFormChange(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)(Java Doc) protected void onFormChange(HttpServletRequest request, HttpServletResponse response, Object command) throws Exception(Code)(Java Doc) protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)(Java Doc) protected ModelAndView onSubmit(Object command, BindException errors) throws Exception(Code)(Java Doc) protected ModelAndView onSubmit(Object command) throws Exception(Code)(Java Doc) protected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)(Java Doc) protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception(Code)(Java Doc) protected Map referenceData(HttpServletRequest request) throws Exception(Code)(Java Doc) final public void setFormView(String formView)(Code)(Java Doc) final public void setSuccessView(String successView)(Code)(Java Doc) protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception(Code)(Java Doc) protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors, Map controlModel) throws Exception(Code)(Java Doc) protected boolean suppressValidation(HttpServletRequest request, Object command)(Code)(Java Doc)
|
Methods inherited from org.springframework.web.servlet.mvc.AbstractFormController | protected Object currentFormObject(HttpServletRequest request, Object sessionFormObject) throws Exception(Code)(Java Doc) protected Object formBackingObject(HttpServletRequest request) throws Exception(Code)(Java Doc) final protected Object getCommand(HttpServletRequest request) throws Exception(Code)(Java Doc) final protected BindException getErrorsForNewForm(HttpServletRequest request) throws Exception(Code)(Java Doc) protected String getFormSessionAttributeName(HttpServletRequest request)(Code)(Java Doc) protected String getFormSessionAttributeName()(Code)(Java Doc) protected ModelAndView handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc) protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc) final public boolean isBindOnNewForm()(Code)(Java Doc) protected boolean isFormSubmission(HttpServletRequest request)(Code)(Java Doc) final public boolean isSessionForm()(Code)(Java Doc) protected void onBindOnNewForm(HttpServletRequest request, Object command, BindException errors) throws Exception(Code)(Java Doc) protected void onBindOnNewForm(HttpServletRequest request, Object command) throws Exception(Code)(Java Doc) abstract protected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)(Java Doc) protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception(Code)(Java Doc) final public void setBindOnNewForm(boolean bindOnNewForm)(Code)(Java Doc) final public void setSessionForm(boolean sessionForm)(Code)(Java Doc) abstract protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception(Code)(Java Doc) final protected ModelAndView showForm(HttpServletRequest request, BindException errors, String viewName) throws Exception(Code)(Java Doc) final protected ModelAndView showForm(HttpServletRequest request, BindException errors, String viewName, Map controlModel) throws Exception(Code)(Java Doc) final protected ModelAndView showNewForm(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc)
|
Fields inherited from org.springframework.web.servlet.mvc.BaseCommandController | final public static String DEFAULT_COMMAND_NAME(Code)(Java Doc)
|
Methods inherited from org.springframework.web.servlet.mvc.BaseCommandController | final protected ServletRequestDataBinder bindAndValidate(HttpServletRequest request, Object command) throws Exception(Code)(Java Doc) final protected boolean checkCommand(Object command)(Code)(Java Doc) protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object command) throws Exception(Code)(Java Doc) final protected Object createCommand() throws Exception(Code)(Java Doc) final public BindingErrorProcessor getBindingErrorProcessor()(Code)(Java Doc) protected Object getCommand(HttpServletRequest request) throws Exception(Code)(Java Doc) final public Class getCommandClass()(Code)(Java Doc) final public String getCommandName()(Code)(Java Doc) final public MessageCodesResolver getMessageCodesResolver()(Code)(Java Doc) final public PropertyEditorRegistrar[] getPropertyEditorRegistrars()(Code)(Java Doc) final public Validator getValidator()(Code)(Java Doc) final public Validator[] getValidators()(Code)(Java Doc) protected void initApplicationContext()(Code)(Java Doc) protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception(Code)(Java Doc) final public boolean isValidateOnBinding()(Code)(Java Doc) protected void onBind(HttpServletRequest request, Object command, BindException errors) throws Exception(Code)(Java Doc) protected void onBind(HttpServletRequest request, Object command) throws Exception(Code)(Java Doc) protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors) throws Exception(Code)(Java Doc) final protected void prepareBinder(ServletRequestDataBinder binder)(Code)(Java Doc) final public void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor)(Code)(Java Doc) final public void setCommandClass(Class commandClass)(Code)(Java Doc) final public void setCommandName(String commandName)(Code)(Java Doc) final public void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)(Code)(Java Doc) final public void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)(Code)(Java Doc) final public void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars)(Code)(Java Doc) final public void setValidateOnBinding(boolean validateOnBinding)(Code)(Java Doc) final public void setValidator(Validator validator)(Code)(Java Doc) final public void setValidators(Validator[] validators)(Code)(Java Doc) protected boolean suppressBinding(HttpServletRequest request)(Code)(Java Doc) protected boolean suppressValidation(HttpServletRequest request, Object command, BindException errors)(Code)(Java Doc) protected boolean suppressValidation(HttpServletRequest request, Object command)(Code)(Java Doc) protected boolean suppressValidation(HttpServletRequest request)(Code)(Java Doc) protected boolean useDirectFieldAccess()(Code)(Java Doc)
|
|
|