Java Doc for CancellableFormController.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » servlet » mvc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.web.servlet.mvc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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):

  1. 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.
  2. 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)




Method Summary
final public  StringgetCancelParamKey()
     Return the key of the request parameter used to identify a cancel request.
final public  StringgetCancelView()
     Gets the name of the cancel view.
protected  booleanisCancelRequest(HttpServletRequest request)
     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.

protected  booleanisFormSubmission(HttpServletRequest request)
     Consider an explicit cancel request as a form submission too.
protected  ModelAndViewonCancel(HttpServletRequest request, HttpServletResponse response, Object command)
     Callback method for handling a cancel request.
protected  ModelAndViewonCancel(Object command)
     Simple onCancel version.
protected  ModelAndViewprocessFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
     This implementation first checks to see if the incoming is a cancel request, through a call to CancellableFormController.isCancelRequest .
final public  voidsetCancelParamKey(String cancelParamKey)
     Set the key of the request parameter used to identify a cancel request.
final public  voidsetCancelView(String cancelView)
     Sets the name of the cancel view.
protected  booleansuppressValidation(HttpServletRequest request, Object command)
     Suppress validation for an explicit cancel request too.



Method Detail
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




isFormSubmission
protected boolean isFormSubmission(HttpServletRequest request)(Code)
Consider an explicit cancel request as a form submission too.
See Also:   CancellableFormController.isCancelRequest(javax.servlet.http.HttpServletRequest)



onCancel
protected ModelAndView onCancel(HttpServletRequest request, HttpServletResponse response, Object command) throws Exception(Code)
Callback method for handling a cancel request. Called if CancellableFormController.isCancelRequest 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 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 CancellableFormController.setCancelView(String) rather than overriding an onCancel method.
Parameters:
  request - current servlet request
Parameters:
  response - current servlet response
Parameters:
  command - form object with request parameters bound onto it the prepared model and view, or null
throws:
  Exception - in case of errors
See Also:   CancellableFormController.isCancelRequest(javax.servlet.http.HttpServletRequest)
See Also:   CancellableFormController.onCancel(Object)
See Also:   CancellableFormController.setCancelView




onCancel
protected ModelAndView onCancel(Object command) throws Exception(Code)
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 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 CancellableFormController.setCancelView(String) rather than overriding an onCancel method.
Parameters:
  command - form object with request parameters bound onto it the prepared model and view, or null
throws:
  Exception - in case of errors
See Also:   CancellableFormController.onCancel(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,Object)
See Also:   CancellableFormController.setCancelView




processFormSubmission
protected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)
This implementation first checks to see if the incoming is a cancel request, through a call to CancellableFormController.isCancelRequest . If so, control is passed to CancellableFormController.onCancel ; otherwise, control is passed up to SimpleFormController.processFormSubmission .
See Also:   CancellableFormController.isCancelRequest
See Also:   CancellableFormController.onCancel(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,Object)
See Also:   SimpleFormController.processFormSubmission



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.



suppressValidation
protected boolean suppressValidation(HttpServletRequest request, Object command)(Code)
Suppress validation for an explicit cancel request too.
See Also:   CancellableFormController.isCancelRequest(javax.servlet.http.HttpServletRequest)



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)

Methods inherited from org.springframework.web.servlet.mvc.AbstractController
final public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc)
abstract protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc)
final public boolean isSynchronizeOnSession()(Code)(Java Doc)
final public void setSynchronizeOnSession(boolean synchronizeOnSession)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.