Java Doc for AbstractWizardFormController.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.AbstractWizardFormController

AbstractWizardFormController
abstract public class AbstractWizardFormController extends AbstractFormController (Code)
Form controller for typical wizard-style workflows.

In contrast to classic forms, wizards have more than one form view page. Therefore, there are various actions instead of one single submit action:

  • finish: trying to leave the wizard successfully, that is, perform its final action, and thus requiring a valid state;
  • cancel: leaving the wizard without performing its final action, and thus without regard to the validity of its current state;
  • page change: showing another wizard page, e.g. the next or previous one, with regard to "dirty back" and "dirty forward".

Finish and cancel actions can be triggered by request parameters, named PARAM_FINISH ("_finish") and PARAM_CANCEL ("_cancel"), ignoring parameter values to allow for HTML buttons. The target page for page changes can be specified by PARAM_TARGET, appending the page number to the parameter name (e.g. "_target1"). The action parameters are recognized when triggered by image buttons too (via "_finish.x", "_abort.x", or "_target1.x").

The current page number will be stored in the session. It can also be specified as request parameter PARAM_PAGE, to properly handle usage of the back button in a browser: In this case, a submission always contains the correct page number, even if the user submitted from an old view.

The page can only be changed if it validates correctly, except if a "dirty back" or "dirty forward" is allowed. At finish, all pages get validated again to guarantee a consistent state.

Note that a validator's default validate method is not executed when using this class! Rather, the AbstractWizardFormController.validatePage implementation should call special validateXXX methods that the validator needs to provide, validating certain pieces of the object. These can be combined to validate the elements of individual pages.

Note: Page numbering starts with 0, to be able to pass an array consisting of the corresponding view names to the "pages" bean property.
author:
   Juergen Hoeller
since:
   25.04.2003
See Also:   AbstractWizardFormController.setPages
See Also:   AbstractWizardFormController.validatePage
See Also:   AbstractWizardFormController.processFinish
See Also:   AbstractWizardFormController.processCancel



Field Summary
final public static  StringPARAM_CANCEL
     Parameter triggering the cancel action.
final public static  StringPARAM_FINISH
     Parameter triggering the finish action.
final public static  StringPARAM_PAGE
     Parameter specifying the current page as value.
final public static  StringPARAM_TARGET
     Parameter specifying the target page, appending the page number to the name.

Constructor Summary
public  AbstractWizardFormController()
     Create a new AbstractWizardFormController.

Method Summary
protected  intgetCurrentPage(HttpServletRequest request)
     Return the current page number.
protected  intgetInitialPage(HttpServletRequest request, Object command)
     Return the initial page of the wizard, that is, the page shown at wizard startup.
protected  intgetInitialPage(HttpServletRequest request)
     Return the initial page of the wizard, that is, the page shown at wizard startup.
final public  StringgetPageAttribute()
     Return the name of the page attribute in the model.
final protected  intgetPageCount()
     Return the number of wizard pages. Useful to check whether the last page has been reached.

Note that a concrete wizard form controller might override AbstractWizardFormController.getPageCount(HttpServletRequest,Object) to determine the page count dynamically.

protected  intgetPageCount(HttpServletRequest request, Object command)
     Return the page count for this wizard form controller.
protected  StringgetPageSessionAttributeName(HttpServletRequest request)
     Return the name of the HttpSession attribute that holds the page object for this wizard form controller.
protected  StringgetPageSessionAttributeName()
     Return the name of the HttpSession attribute that holds the page object for this wizard form controller.

Default is an internal name, of no relevance to applications, as the form session attribute is not usually accessed directly.

final public  String[]getPages()
     Return the wizard pages, i.e.
protected  intgetTargetPage(HttpServletRequest request, Object command, Errors errors, int currentPage)
     Return the target page specified in the request.
protected  intgetTargetPage(HttpServletRequest request, int currentPage)
     Return the target page specified in the request.

The default implementation examines "_target" parameter (e.g.

protected  StringgetViewName(HttpServletRequest request, Object command, int page)
     Return the name of the view for the specified page of this wizard form controller.
protected  ModelAndViewhandleInvalidSubmit(HttpServletRequest request, HttpServletResponse response)
     Handle an invalid submit request, e.g.
final public  booleanisAllowDirtyBack()
     Return whether "dirty back" is allowed.
final public  booleanisAllowDirtyForward()
     Return whether "dirty forward" is allowed.
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 "_cancel" key is present in the request, otherwise it returns false.

protected  booleanisFinishRequest(HttpServletRequest request)
     Determine whether the incoming request is a request to finish the processing of the current form.

By default, this method returns true if a parameter matching the "_finish" key is present in the request, otherwise it returns false.

protected  booleanisFormSubmission(HttpServletRequest request)
     Consider an explicit finish or cancel request as a form submission too.
final protected  voidonBindAndValidate(HttpServletRequest request, Object command, BindException errors)
     Calls page-specific onBindAndValidate method.
protected  voidonBindAndValidate(HttpServletRequest request, Object command, BindException errors, int page)
     Callback for custom post-processing in terms of binding and validation.
protected  voidpostProcessPage(HttpServletRequest request, Object command, Errors errors, int page)
     Post-process the given page after binding and validation, potentially updating its command object.
protected  ModelAndViewprocessCancel(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
     Template method for processing the cancel action of this wizard.

The default implementation throws a ServletException, saying that a cancel operation is not supported by this controller.

abstract protected  ModelAndViewprocessFinish(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
     Template method for processing the final action of this wizard.
final protected  ModelAndViewprocessFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)
     Apply wizard workflow: finish, cancel, page change.
final protected  MapreferenceData(HttpServletRequest request, Object command, Errors errors)
     Calls page-specific referenceData method.
protected  MapreferenceData(HttpServletRequest request, Object command, Errors errors, int page)
     Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
protected  MapreferenceData(HttpServletRequest request, int page)
     Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.
final public  voidsetAllowDirtyBack(boolean allowDirtyBack)
     Set if "dirty back" is allowed, that is, if moving to a former wizard page is allowed in case of validation errors for the current page.
final public  voidsetAllowDirtyForward(boolean allowDirtyForward)
     Set if "dirty forward" is allowed, that is, if moving to a later wizard page is allowed in case of validation errors for the current page.
final public  voidsetPageAttribute(String pageAttribute)
     Set the name of the page attribute in the model, containing an Integer with the current page number.
final public  voidsetPages(String[] pages)
     Set the wizard pages, i.e.
final protected  ModelAndViewshowForm(HttpServletRequest request, HttpServletResponse response, BindException errors)
     Show first page as form view.
final protected  ModelAndViewshowPage(HttpServletRequest request, BindException errors, int page)
     Prepare the form model and view, including reference and error data, for the given page.
protected  voidvalidatePage(Object command, Errors errors, int page, boolean finish)
     Template method for custom validation logic for individual pages. The default implementation calls AbstractWizardFormController.validatePage(Object,Errors,int) .

Implementations will typically call fine-granular validateXXX methods of this instance's Validator, combining them to validation of the corresponding pages.

protected  voidvalidatePage(Object command, Errors errors, int page)
     Template method for custom validation logic for individual pages.

Field Detail
PARAM_CANCEL
final public static String PARAM_CANCEL(Code)
Parameter triggering the cancel action. Can be called from any wizard page!



PARAM_FINISH
final public static String PARAM_FINISH(Code)
Parameter triggering the finish action. Can be called from any wizard page!



PARAM_PAGE
final public static String PARAM_PAGE(Code)
Parameter specifying the current page as value. Not necessary on form pages, but allows to properly handle usage of the back button.
See Also:   AbstractWizardFormController.setPageAttribute



PARAM_TARGET
final public static String PARAM_TARGET(Code)
Parameter specifying the target page, appending the page number to the name.




Constructor Detail
AbstractWizardFormController
public AbstractWizardFormController()(Code)
Create a new AbstractWizardFormController.

"sessionForm" is automatically turned on, "validateOnBinding" turned off, and "cacheSeconds" set to 0 by the base class (-> no caching for all form controllers).





Method Detail
getCurrentPage
protected int getCurrentPage(HttpServletRequest request)(Code)
Return the current page number. Used by processFormSubmission.

The default implementation checks the page session attribute. Subclasses can override this for customized page determination.
See Also:   AbstractWizardFormController.processFormSubmission
See Also:   AbstractWizardFormController.getPageSessionAttributeName




getInitialPage
protected int getInitialPage(HttpServletRequest request, Object command)(Code)
Return the initial page of the wizard, that is, the page shown at wizard startup.

The default implementation delegates to AbstractWizardFormController.getInitialPage(HttpServletRequest) .
Parameters:
  request - current HTTP request
Parameters:
  command - the command object as returned by formBackingObject the initial page number
See Also:   AbstractWizardFormController.getInitialPage(HttpServletRequest)
See Also:   AbstractWizardFormController.formBackingObject




getInitialPage
protected int getInitialPage(HttpServletRequest request)(Code)
Return the initial page of the wizard, that is, the page shown at wizard startup.

The default implementation returns 0 for first page.
Parameters:
  request - current HTTP request the initial page number




getPageAttribute
final public String getPageAttribute()(Code)
Return the name of the page attribute in the model.



getPageCount
final protected int getPageCount()(Code)
Return the number of wizard pages. Useful to check whether the last page has been reached.

Note that a concrete wizard form controller might override AbstractWizardFormController.getPageCount(HttpServletRequest,Object) to determine the page count dynamically. The default implementation of that extended getPageCount variant returns the static page count as determined by this getPageCount() method.
See Also:   AbstractWizardFormController.getPageCount(javax.servlet.http.HttpServletRequest,Object)




getPageCount
protected int getPageCount(HttpServletRequest request, Object command)(Code)
Return the page count for this wizard form controller. The default implementation delegates to AbstractWizardFormController.getPageCount() .

Can be overridden to dynamically adapt the page count.
Parameters:
  request - current HTTP request
Parameters:
  command - the command object as returned by formBackingObject the current page count
See Also:   AbstractWizardFormController.getPageCount




getPageSessionAttributeName
protected String getPageSessionAttributeName(HttpServletRequest request)(Code)
Return the name of the HttpSession attribute that holds the page object for this wizard form controller.

The default implementation delegates to the AbstractWizardFormController.getPageSessionAttributeName() variant without arguments.
Parameters:
  request - current HTTP request the name of the form session attribute, or null if not in session form mode
See Also:   AbstractWizardFormController.getPageSessionAttributeName
See Also:   AbstractWizardFormController.getFormSessionAttributeName(javax.servlet.http.HttpServletRequest)
See Also:   javax.servlet.http.HttpSession.getAttribute




getPageSessionAttributeName
protected String getPageSessionAttributeName()(Code)
Return the name of the HttpSession attribute that holds the page object for this wizard form controller.

Default is an internal name, of no relevance to applications, as the form session attribute is not usually accessed directly. Can be overridden to use an application-specific attribute name, which allows other code to access the session attribute directly. the name of the page session attribute
See Also:   AbstractWizardFormController.getFormSessionAttributeName
See Also:   javax.servlet.http.HttpSession.getAttribute




getPages
final public String[] getPages()(Code)
Return the wizard pages, i.e. the view names for the pages. The array index corresponds to the page number.

Note that a concrete wizard form controller might override AbstractWizardFormController.getViewName(HttpServletRequest,Object,int) to determine the view name for each page dynamically.
See Also:   AbstractWizardFormController.getViewName(javax.servlet.http.HttpServletRequest,Object,int)




getTargetPage
protected int getTargetPage(HttpServletRequest request, Object command, Errors errors, int currentPage)(Code)
Return the target page specified in the request.

The default implementation delegates to AbstractWizardFormController.getTargetPage(HttpServletRequest,int) . Subclasses can override this for customized target page determination.
Parameters:
  request - current HTTP request
Parameters:
  command - form object with request parameters bound onto it
Parameters:
  errors - validation errors holder
Parameters:
  currentPage - the current page, to be returned as fallbackif no target page specified the page specified in the request, or current page if not found
See Also:   AbstractWizardFormController.getTargetPage(HttpServletRequest,int)




getTargetPage
protected int getTargetPage(HttpServletRequest request, int currentPage)(Code)
Return the target page specified in the request.

The default implementation examines "_target" parameter (e.g. "_target1"). Subclasses can override this for customized target page determination.
Parameters:
  request - current HTTP request
Parameters:
  currentPage - the current page, to be returned as fallbackif no target page specified the page specified in the request, or current page if not found
See Also:   AbstractWizardFormController.PARAM_TARGET




getViewName
protected String getViewName(HttpServletRequest request, Object command, int page)(Code)
Return the name of the view for the specified page of this wizard form controller.

The default implementation takes the view name from the AbstractWizardFormController.getPages() array.

Can be overridden to dynamically switch the page view or to return view names for dynamically defined pages.
Parameters:
  request - current HTTP request
Parameters:
  command - the command object as returned by formBackingObject the current page count
See Also:   AbstractWizardFormController.getPageCount




handleInvalidSubmit
protected ModelAndView handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Handle an invalid submit request, e.g. when in session form mode but no form object was found in the session (like in case of an invalid resubmit by the browser).

The default implementation for wizard form controllers simply shows the initial page of a new wizard form. If you want to show some "invalid submit" message, you need to override this method.
Parameters:
  request - current HTTP request
Parameters:
  response - current HTTP response a prepared view, or null if handled directly
throws:
  Exception - in case of errors
See Also:   AbstractWizardFormController.showNewForm
See Also:   AbstractWizardFormController.setBindOnNewForm




isAllowDirtyBack
final public boolean isAllowDirtyBack()(Code)
Return whether "dirty back" is allowed.



isAllowDirtyForward
final public boolean isAllowDirtyForward()(Code)
Return whether "dirty forward" is allowed.



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 "_cancel" key 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:   AbstractWizardFormController.PARAM_CANCEL




isFinishRequest
protected boolean isFinishRequest(HttpServletRequest request)(Code)
Determine whether the incoming request is a request to finish the processing of the current form.

By default, this method returns true if a parameter matching the "_finish" key is present in the request, otherwise it returns false. Subclasses may override this method to provide custom logic to detect a finish request.

The parameter is recognized both when sent as a plain parameter ("_finish") or when triggered by an image button ("_finish.x").
Parameters:
  request - current HTTP request
See Also:   AbstractWizardFormController.PARAM_FINISH




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



onBindAndValidate
final protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors) throws Exception(Code)
Calls page-specific onBindAndValidate method.



onBindAndValidate
protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors, int page) throws Exception(Code)
Callback for custom post-processing in terms of binding and validation. Called on each submit, after standard binding but before page-specific validation of this wizard form controller.

Note: AbstractWizardFormController does not perform standand validation on binding but rather applies page-specific validation on processing the form submission.
Parameters:
  request - current HTTP request
Parameters:
  command - bound command
Parameters:
  errors - Errors instance for additional custom validation
Parameters:
  page - current wizard page
throws:
  Exception - in case of invalid state or arguments
See Also:   AbstractWizardFormController.bindAndValidate
See Also:   AbstractWizardFormController.processFormSubmission
See Also:   org.springframework.validation.Errors




postProcessPage
protected void postProcessPage(HttpServletRequest request, Object command, Errors errors, int page) throws Exception(Code)
Post-process the given page after binding and validation, potentially updating its command object. The passed-in request might contain special parameters sent by the page.

Only invoked when displaying another page or the same page again, not when finishing or cancelling.
Parameters:
  request - current HTTP request
Parameters:
  command - form object with request parameters bound onto it
Parameters:
  errors - validation errors holder
Parameters:
  page - number of page to post-process
throws:
  Exception - in case of invalid state or arguments




processCancel
protected ModelAndView processCancel(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)
Template method for processing the cancel action of this wizard.

The default implementation throws a ServletException, saying that a cancel operation is not supported by this controller. Thus, you do not need to implement this template method if you do not support a cancel operation.

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.
Parameters:
  request - current HTTP request
Parameters:
  response - current HTTP response
Parameters:
  command - form object with the current wizard state
Parameters:
  errors - Errors instance containing errors the cancellation view
throws:
  Exception - in case of invalid state or arguments
See Also:   org.springframework.validation.Errors
See Also:   org.springframework.validation.BindException.getModel




processFinish
abstract protected ModelAndView processFinish(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)
Template method for processing the final action of this wizard.

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.

You can call the AbstractWizardFormController.showPage method to return back to the wizard, in case of last-minute validation errors having been found that you would like to present to the user within the original wizard form.
Parameters:
  request - current HTTP request
Parameters:
  response - current HTTP response
Parameters:
  command - form object with the current wizard state
Parameters:
  errors - validation errors holder the finish view
throws:
  Exception - in case of invalid state or arguments
See Also:   org.springframework.validation.Errors
See Also:   org.springframework.validation.BindException.getModel
See Also:   AbstractWizardFormController.showPage(javax.servlet.http.HttpServletRequest,org.springframework.validation.BindException,int)




processFormSubmission
final protected ModelAndView processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception(Code)
Apply wizard workflow: finish, cancel, page change.



referenceData
final protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception(Code)
Calls page-specific referenceData method.



referenceData
protected Map referenceData(HttpServletRequest request, Object command, Errors errors, int page) throws Exception(Code)
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation delegates to referenceData(HttpServletRequest, int). Subclasses can override this to set reference data used in the view.
Parameters:
  request - current HTTP request
Parameters:
  command - form object with request parameters bound onto it
Parameters:
  errors - validation errors holder
Parameters:
  page - current wizard page a Map with reference data entries, or null if none
throws:
  Exception - in case of invalid state or arguments
See Also:   AbstractWizardFormController.referenceData(HttpServletRequest,int)
See Also:   ModelAndView




referenceData
protected Map referenceData(HttpServletRequest request, int page) throws Exception(Code)
Create a reference data map for the given request, consisting of bean name/bean instance pairs as expected by ModelAndView.

The default implementation returns null. Subclasses can override this to set reference data used in the view.
Parameters:
  request - current HTTP request
Parameters:
  page - current wizard page a Map with reference data entries, or null if none
throws:
  Exception - in case of invalid state or arguments
See Also:   ModelAndView




setAllowDirtyBack
final public void setAllowDirtyBack(boolean allowDirtyBack)(Code)
Set if "dirty back" is allowed, that is, if moving to a former wizard page is allowed in case of validation errors for the current page.
Parameters:
  allowDirtyBack - if "dirty back" is allowed



setAllowDirtyForward
final public void setAllowDirtyForward(boolean allowDirtyForward)(Code)
Set if "dirty forward" is allowed, that is, if moving to a later wizard page is allowed in case of validation errors for the current page.
Parameters:
  allowDirtyForward - if "dirty forward" is allowed



setPageAttribute
final public void setPageAttribute(String pageAttribute)(Code)
Set the name of the page attribute in the model, containing an Integer with the current page number.

This will be necessary for single views rendering multiple view pages. It also allows for specifying the optional "_page" parameter.
Parameters:
  pageAttribute - name of the page attribute
See Also:   AbstractWizardFormController.PARAM_PAGE




setPages
final public void setPages(String[] pages)(Code)
Set the wizard pages, i.e. the view names for the pages. The array index is interpreted as page number.
Parameters:
  pages - view names for the pages



showForm
final protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception(Code)
Show first page as form view.



showPage
final protected ModelAndView showPage(HttpServletRequest request, BindException errors, int page) throws Exception(Code)
Prepare the form model and view, including reference and error data, for the given page. Can be used in AbstractWizardFormController.processFinish implementations, to show the corresponding page in case of validation errors.
Parameters:
  request - current HTTP request
Parameters:
  errors - validation errors holder
Parameters:
  page - number of page to show the prepared form view
throws:
  Exception - in case of invalid state or arguments



validatePage
protected void validatePage(Object command, Errors errors, int page, boolean finish)(Code)
Template method for custom validation logic for individual pages. The default implementation calls AbstractWizardFormController.validatePage(Object,Errors,int) .

Implementations will typically call fine-granular validateXXX methods of this instance's Validator, combining them to validation of the corresponding pages. The Validator's default validate method will not be called by a wizard form controller!
Parameters:
  command - form object with the current wizard state
Parameters:
  errors - validation errors holder
Parameters:
  page - number of page to validate
Parameters:
  finish - whether this method is called during final revalidation on finish(else, it is called for validating the current page)
See Also:   AbstractWizardFormController.validatePage(Object,Errors,int)
See Also:   org.springframework.validation.Validator.validate




validatePage
protected void validatePage(Object command, Errors errors, int page)(Code)
Template method for custom validation logic for individual pages. The default implementation is empty.

Implementations will typically call fine-granular validateXXX methods of this instance's validator, combining them to validation of the corresponding pages. The validator's default validate method will not be called by a wizard form controller!
Parameters:
  command - form object with the current wizard state
Parameters:
  errors - validation errors holder
Parameters:
  page - number of page to validate
See Also:   org.springframework.validation.Validator.validate




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.