This class is deprecated.
as of Spring 3.0, in favor of annotated controllers
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):
processFormSubmission
which calls
isCancelRequest(HttpServletRequest)
to see if the incoming request is to cancel the
current form entry. By default, isCancelRequest(HttpServletRequest)
returns true
if the configured cancelParamKey
exists in the request.
This behavior can be overridden in subclasses.isCancelRequest(HttpServletRequest)
returns false
, then the controller
will delegate all processing back to SimpleFormController
,
otherwise it will call the onCancel(Object)
version with all parameters.
By default, that method will delegate to the onCancel(Object)
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!
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the key of the request parameter used to identify a cancel request.
| |||||||||||
Gets the name of the cancel view.
| |||||||||||
Set the key of the request parameter used to identify a cancel request.
| |||||||||||
Sets the name of the cancel view.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determine whether the incoming request is a request to cancel the
processing of the current form.
| |||||||||||
Consider an explicit cancel request as a form submission too.
| |||||||||||
Callback method for handling a cancel request.
| |||||||||||
Simple
onCancel version. | |||||||||||
This implementation first checks to see if the incoming is a cancel request,
through a call to
isCancelRequest(HttpServletRequest) . | |||||||||||
Suppress validation for an explicit cancel request too.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Return the key of the request parameter used to identify a cancel request.
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").
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").
request | current HTTP request |
---|
setCancelParamKey(String)
Consider an explicit cancel request as a form submission too.
request | current HTTP request |
---|
Callback method for handling a cancel request. Called if isCancelRequest(HttpServletRequest)
returns true
.
Default implementation delegates to onCancel(Object)
to return
the configured cancelView
. Subclasses may override either of the two
methods to build a custom ModelAndView
that may contain model
parameters used in the cancel view.
If you simply want to move the user to a new view and you don't want to add
additional model parameters, use setCancelView(String)
rather than
overriding an onCancel
method.
request | current servlet request |
---|---|
response | current servlet response |
command | form object with request parameters bound onto it |
null
Exception | in case of errors |
---|
Simple onCancel
version. Called by the default implementation
of the onCancel
version with all parameters.
Default implementation returns eturns the configured cancelView
.
Subclasses may override this method to build a custom ModelAndView
that may contain model parameters used in the cancel view.
If you simply want to move the user to a new view and you don't want to add
additional model parameters, use setCancelView(String)
rather than
overriding an onCancel
method.
command | form object with request parameters bound onto it |
---|
null
Exception | in case of errors |
---|
This implementation first checks to see if the incoming is a cancel request,
through a call to isCancelRequest(HttpServletRequest)
. If so, control is passed to
onCancel(Object)
; otherwise, control is passed up to
processFormSubmission(HttpServletRequest, HttpServletResponse, Object, BindException)
.
request | current servlet request |
---|---|
response | current servlet response |
command | form object with request parameters bound onto it |
errors | holder without errors (subclass can add errors if it wants to) |
null
Exception |
---|
Suppress validation for an explicit cancel request too.
request | current HTTP request |
---|---|
command | the command object to validate |