Java Doc for FormAction.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » action » 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 » Workflow Engines » spring webflow 1.0.4 » org.springframework.webflow.action 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.webflow.action.AbstractAction
      org.springframework.webflow.action.MultiAction
         org.springframework.webflow.action.FormAction

FormAction
public class FormAction extends MultiAction implements InitializingBean(Code)
Multi-action that implements common logic dealing with input forms. This class leverages the Spring Web data binding code to do binding and validation.

Several action execution methods are provided:

Since this is a multi-action a subclass could add any number of additional action execution methods, e.g. "setupReferenceData(RequestContext)", or "processSubmit(RequestContext)".

Using this action, it becomes very easy to implement form preparation and submission logic in your flow. One way to do this follows:

  1. Create a view state to display the form. In a render action of that state, invoke FormAction.setupForm(RequestContext) setupForm to prepare the new form for display.
  2. On a matching "submit" transition execute an action that invokes FormAction.bindAndValidate(RequestContext) bindAndValidate to bind incoming request parameters to the form object and validate the form object.
  3. If there are binding or validation errors, the transition will not be allowed and the view state will automatically be re-entered.
  4. If binding and validation is successful go to an action state called "processSubmit" (or any other appropriate name). This will invoke an action method called "processSubmit" you must provide on a subclass to process form submission, e.g. interacting with the business logic.
  5. If business processing is ok, continue to a view state to display the success view.

Here is an example implementation of such a compact form flow:

 <view-state id="displayCriteria" view="searchCriteria">
 <render-actions>
 <action bean="formAction" method="setupForm"/>
 </render-actions>
 <transition on="search" to="executeSearch">
 <action bean="formAction" method="bindAndValidate"/>
 </transition>
 </view-state>
 <action-state id="executeSearch">
 <action bean="formAction" method="executeSearch"/>
 <transition on="success" to="displayResults"/>
 </action-state>
 

When you need additional flexibility consider splitting the view state above acting as a single logical form state into multiple states. For example, you could have one action state handle form setup, a view state trigger form display, another action state handle data binding and validation, and another process form submission. This would be a bit more verbose but would also give you more control over how you respond to specific results of fine-grained actions that occur within the flow.

Subclassing hooks:

Note that this action does not provide a referenceData() hook method similar to that of Spring MVC's SimpleFormController. If you wish to expose reference data to populate form drop downs you can define a custom action method in your FormAction subclass that does just that. Simply invoke it as either a chained action as part of the setupForm state, or as a fine grained state definition itself.

For example, you might create this method in your subclass:

 public Event setupReferenceData(RequestContext context) throws Exception {
 MutableAttributeMap requestScope = context.getRequestScope();
 requestScope.put("refData", lookupService.getSupportingFormData());
 return success();
 }
 
... and then invoke it like this:
 <view-state id="displayCriteria" view="searchCriteria">
 <render-actions>
 <action bean="searchFormAction" method="setupForm"/>
 <action bean="searchFormAction" method="setupReferenceData"/>
 </render-actions>
 ...
 </view-state>
 
This style of calling multiple action methods in a chain (Chain of Responsibility) is preferred to overridding a single action method. In general, action method overriding is discouraged.

When it comes to validating submitted input data using a registered org.springframework.validation.Validator , this class offers the following options:

  • If you don't want validation at all, just call FormAction.bind(RequestContext) instead of FormAction.bindAndValidate(RequestContext) or don't register a validator.
  • If you want piecemeal validation, e.g. in a multi-page wizard, call FormAction.bindAndValidate(RequestContext) or FormAction.validate(RequestContext) and specify a FormAction.VALIDATOR_METHOD_ATTRIBUTE validatorMethod action execution attribute. This will invoke the identified custom validator method on the validator. The validator method signature should follow the following pattern:
     public void ${validateMethodName}(${formObjectClass}, Errors)
     
    For instance, having a action definition like this:
     <action bean="searchFormAction" method="bindAndValidate">
     <attribute name="validatorMethod" value="validateSearchCriteria"/>
     </action>
     
    Would result in the public void validateSearchCriteria(SearchCriteria, Errors) method of the registered validator being called if the form object class would be SearchCriteria.
  • If you want to do full validation using the org.springframework.validation.Validator.validate(java.lang.Objectorg.springframework.validation.Errors) validate method of the registered validator, call FormAction.bindAndValidate(RequestContext) or FormAction.validate(RequestContext) without specifying a "validatorMethod" action execution attribute.

FormAction configurable properties
name default description
formObjectName formObject The name of the form object. The form object will be set in the configured scope using this name.
formObjectClass null The form object class for this action. An instance of this class will get populated and validated. Required when using a validator.
formObjectScope org.springframework.webflow.execution.ScopeType.FLOW flow The scope in which the form object will be put. If put in flow scope the object will be cached and reused over the life of the flow, preserving previous values. Request scope will cause a new fresh form object instance to be created on each request into the flow execution.
formErrorsScope org.springframework.webflow.execution.ScopeType.FLASH flash The scope in which the form object errors instance will be put. If put in flash scope form errors will be cached until the next user event is signaled.
propertyEditorRegistrar null The strategy used to register custom property editors with the data binder. This is an alternative to overriding the FormAction.registerPropertyEditors(PropertyEditorRegistry) hook method.
validator null The validator for this action. The validator must support the specified form object class.
messageCodesResolver null Set the strategy to use for resolving errors into message codes.

See Also:   org.springframework.beans.PropertyEditorRegistrar
See Also:   org.springframework.validation.DataBinder
See Also:   ScopeType
author:
   Erwin Vervaet
author:
   Keith Donald



Field Summary
final public static  StringDEFAULT_FORM_OBJECT_NAME
     The default form object name ("formObject").
final public static  StringVALIDATOR_METHOD_ATTRIBUTE
     Optional attribute that identifies the method that should be invoked on the configured validator instance, to support piecemeal wizard page validation ("validatorMethod").

Constructor Summary
public  FormAction()
     Bean-style default constructor; creates a initially unconfigured FormAction instance relying on default property values.
public  FormAction(Class formObjectClass)
     Creates a new form action that manages instance(s) of the specified form object class.

Method Summary
public  Eventbind(RequestContext context)
     Bind incoming request parameters to allowed fields of the form object.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow.

public  EventbindAndValidate(RequestContext context)
     Bind incoming request parameters to allowed fields of the form object and then validate the bound form object if a validator is configured.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow.

protected  DataBindercreateBinder(RequestContext context, Object formObject)
     Create a new binder instance for the given form object and request context.
protected  ObjectcreateFormObject(RequestContext context)
     Create the backing form object instance that should be managed by this FormAction form action .
protected  voiddoBind(RequestContext context, DataBinder binder)
     Bind allowed parameters in the external context request parameter map to the form object using given binder.
protected  voiddoValidate(RequestContext context, Object formObject, Errors errors)
     Validate given form object using a registered validator.
protected  ErrorsgetFormErrors(RequestContext context)
     Convenience method that returns the form object errors for this form action.
public  ScopeTypegetFormErrorsScope()
     Get the scope in which the Errors object will be placed.
protected  ObjectgetFormObject(RequestContext context)
     Convenience method that returns the form object for this form action.
protected  FormObjectAccessorgetFormObjectAccessor(RequestContext context)
     Factory method that returns a new form object accessor for accessing form objects in the provided request context.
public  ClassgetFormObjectClass()
     Return the form object class for this action.
public  StringgetFormObjectName()
     Return the name of the form object in the configured scope.
public  ScopeTypegetFormObjectScope()
     Get the scope in which the form object will be placed.
public  MessageCodesResolvergetMessageCodesResolver()
     Return the strategy to use for resolving errors into message codes.
public  PropertyEditorRegistrargetPropertyEditorRegistrar()
     Get the property editor registration strategy for this action's data binders.
protected  DispatchMethodInvokergetValidateMethodInvoker()
     Returns a dispatcher to invoke validation methods.
public  ValidatorgetValidator()
     Returns the validator for this action.
protected  voidinitAction()
    
protected  voidinitBinder(RequestContext context, DataBinder binder)
     Initialize a new binder instance.
protected  voidregisterPropertyEditors(RequestContext context, PropertyEditorRegistry registry)
     Register custom editors to perform type conversion on fields of your form object during data binding and form display.
protected  voidregisterPropertyEditors(PropertyEditorRegistry registry)
     Register custom editors to perform type conversion on fields of your form object during data binding and form display.
public  EventresetForm(RequestContext context)
     Resets the form by clearing out the form object in the specified scope and recreating it.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow.

public  voidsetFormErrorsScope(ScopeType errorsScope)
     Set the scope in which the Errors object will be placed.
public  voidsetFormObjectClass(Class formObjectClass)
     Set the form object class for this action.
public  voidsetFormObjectName(String formObjectName)
     Set the name of the form object in the configured scope.
public  voidsetFormObjectScope(ScopeType scopeType)
     Set the scope in which the form object will be placed.
public  voidsetMessageCodesResolver(MessageCodesResolver messageCodesResolver)
     Set the strategy to use for resolving errors into message codes.
public  voidsetPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)
     Set a property editor registration strategy for this action's data binders.
public  voidsetValidator(Validator validator)
     Set the validator for this action.
public  EventsetupForm(RequestContext context)
     Prepares a form object for display in a new form, creating it and caching it in the FormAction.getFormObjectScope() if necessary.
public  Eventvalidate(RequestContext context)
     Validate the form object by invoking the validator if configured.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow.

protected  booleanvalidationEnabled(RequestContext context)
     Return whether validation should be performed given the state of the flow request context.

Field Detail
DEFAULT_FORM_OBJECT_NAME
final public static String DEFAULT_FORM_OBJECT_NAME(Code)
The default form object name ("formObject").



VALIDATOR_METHOD_ATTRIBUTE
final public static String VALIDATOR_METHOD_ATTRIBUTE(Code)
Optional attribute that identifies the method that should be invoked on the configured validator instance, to support piecemeal wizard page validation ("validatorMethod").




Constructor Detail
FormAction
public FormAction()(Code)
Bean-style default constructor; creates a initially unconfigured FormAction instance relying on default property values. Clients invoking this constructor directly must set the formObjectClass property or override FormAction.createFormObject(RequestContext) .
See Also:   FormAction.setFormObjectClass(Class)



FormAction
public FormAction(Class formObjectClass)(Code)
Creates a new form action that manages instance(s) of the specified form object class.
Parameters:
  formObjectClass - the class of the form object (must be instantiable)




Method Detail
bind
public Event bind(RequestContext context) throws Exception(Code)
Bind incoming request parameters to allowed fields of the form object.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow. If you need to execute custom data binding logic have your flow call this method along with your own custom methods as part of a single action chain. Alternatively, override the FormAction.doBind(RequestContext,DataBinder) hook.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope" "success" if there are no binding errors, "error" otherwise
throws:
  Exception - an unrecoverable exception occured, eitherchecked or unchecked




bindAndValidate
public Event bindAndValidate(RequestContext context) throws Exception(Code)
Bind incoming request parameters to allowed fields of the form object and then validate the bound form object if a validator is configured.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow. If you need to execute custom bind and validate logic have your flow call this method along with your own custom methods as part of a single action chain. Alternatively, override the FormAction.doBind(RequestContext,DataBinder) or FormAction.doValidate(RequestContext,Object,Errors) hooks.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope" "success" when binding and validation is successful, "error" ifthere were binding and/or validation errors
throws:
  Exception - an unrecoverable exception occured, eitherchecked or unchecked




createBinder
protected DataBinder createBinder(RequestContext context, Object formObject) throws Exception(Code)
Create a new binder instance for the given form object and request context. Can be overridden to plug in custom DataBinder subclasses.

Default implementation creates a standard WebDataBinder, and invokes FormAction.initBinder(RequestContext,DataBinder) and FormAction.registerPropertyEditors(PropertyEditorRegistry) .
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope"
Parameters:
  formObject - the form object to bind onto the new binder instance
throws:
  Exception - when an unrecoverable exception occurs
See Also:   WebDataBinder
See Also:   FormAction.initBinder(RequestContext,DataBinder)
See Also:   FormAction.setMessageCodesResolver(MessageCodesResolver)




createFormObject
protected Object createFormObject(RequestContext context) throws Exception(Code)
Create the backing form object instance that should be managed by this FormAction form action . By default, will attempt to instantiate a new form object instance of type FormAction.getFormObjectClass() transiently in memory.

Subclasses should override if they need to load the form object from a specific location or resource such as a database or filesystem.

Subclasses should override if they need to customize how a transient form object is assembled during creation.
Parameters:
  context - the action execution context for accessing flow data the form object
throws:
  IllegalStateException - if the FormAction.getFormObjectClass()property is not set and this method has not been overridden
throws:
  Exception - when an unrecoverable exception occurs




doBind
protected void doBind(RequestContext context, DataBinder binder) throws Exception(Code)
Bind allowed parameters in the external context request parameter map to the form object using given binder.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope"
Parameters:
  binder - the data binder to use
throws:
  Exception - when an unrecoverable exception occurs



doValidate
protected void doValidate(RequestContext context, Object formObject, Errors errors) throws Exception(Code)
Validate given form object using a registered validator. If a "validatorMethod" action property is specified for the currently executing action, the identified validator method will be invoked. When no such property is found, the defualt validate() method is invoked.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope"
Parameters:
  formObject - the form object
Parameters:
  errors - the errors instance to record validation errors in
throws:
  Exception - when an unrecoverable exception occurs



getFormErrors
protected Errors getFormErrors(RequestContext context) throws Exception(Code)
Convenience method that returns the form object errors for this form action. If not found in the configured scope, a new form object errors will be created, initialized, and exposed in the confgured FormAction.getFormErrorsScope() scope .

Keep in mind that an Errors instance wraps a form object, so a form object will also be created if required (see FormAction.getFormObject(RequestContext) ).
Parameters:
  context - the flow request context the form errors
throws:
  Exception - when an unrecoverable exception occurs




getFormErrorsScope
public ScopeType getFormErrorsScope()(Code)
Get the scope in which the Errors object will be placed.



getFormObject
protected Object getFormObject(RequestContext context) throws Exception(Code)
Convenience method that returns the form object for this form action. If not found in the configured scope, a new form object will be created by a call to FormAction.createFormObject(RequestContext) and exposed in the configured FormAction.getFormObjectScope() scope .

The returned form object will become the FormObjectAccessor.setCurrentFormObject(ObjectScopeType) current form object.
Parameters:
  context - the flow execution request context the form object
throws:
  Exception - when an unrecoverable exception occurs




getFormObjectAccessor
protected FormObjectAccessor getFormObjectAccessor(RequestContext context)(Code)
Factory method that returns a new form object accessor for accessing form objects in the provided request context.
Parameters:
  context - the flow request context the accessor



getFormObjectClass
public Class getFormObjectClass()(Code)
Return the form object class for this action.



getFormObjectName
public String getFormObjectName()(Code)
Return the name of the form object in the configured scope.



getFormObjectScope
public ScopeType getFormObjectScope()(Code)
Get the scope in which the form object will be placed.



getMessageCodesResolver
public MessageCodesResolver getMessageCodesResolver()(Code)
Return the strategy to use for resolving errors into message codes.



getPropertyEditorRegistrar
public PropertyEditorRegistrar getPropertyEditorRegistrar()(Code)
Get the property editor registration strategy for this action's data binders.



getValidateMethodInvoker
protected DispatchMethodInvoker getValidateMethodInvoker()(Code)
Returns a dispatcher to invoke validation methods. Subclasses could override this to return a custom dispatcher.



getValidator
public Validator getValidator()(Code)
Returns the validator for this action.



initAction
protected void initAction()(Code)



initBinder
protected void initBinder(RequestContext context, DataBinder binder)(Code)
Initialize a new binder instance. This hook allows customization of binder settings such as the DataBinder.getAllowedFields allowed fields , DataBinder.getRequiredFields required fields and DataBinder.initDirectFieldAccess direct field access . Called by FormAction.createBinder(RequestContext,Object) .

Note that registration of custom property editors should be done in FormAction.registerPropertyEditors(PropertyEditorRegistry) , not here! This method will only be called when a new data binder is created.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope"
Parameters:
  binder - new binder instance
See Also:   FormAction.createBinder(RequestContext,Object)




registerPropertyEditors
protected void registerPropertyEditors(RequestContext context, PropertyEditorRegistry registry)(Code)
Register custom editors to perform type conversion on fields of your form object during data binding and form display. This method is called on form errors initialization and FormAction.initBinder(RequestContext,DataBinder) data binder initialization.

Property editors give you full control over how objects are transformed to and from a formatted String form for display on a user interface such as a HTML page.

This default implementation will call the FormAction.registerPropertyEditors(PropertyEditorRegistry) simpler form of the method not taking a RequestContext parameter.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope"
Parameters:
  registry - the property editor registry to register editors in
See Also:   FormAction.registerPropertyEditors(PropertyEditorRegistry)




registerPropertyEditors
protected void registerPropertyEditors(PropertyEditorRegistry registry)(Code)
Register custom editors to perform type conversion on fields of your form object during data binding and form display. This method is called on form errors initialization and FormAction.initBinder(RequestContext,DataBinder) data binder initialization.

Property editors give you full control over how objects are transformed to and from a formatted String form for display on a user interface such as a HTML page.

This default implementation will simply call registerCustomEditors on the FormAction.getPropertyEditorRegistrar() propertyEditorRegistrar object that has been set for the action, if any.
Parameters:
  registry - the property editor registry to register editors in




resetForm
public Event resetForm(RequestContext context) throws Exception(Code)
Resets the form by clearing out the form object in the specified scope and recreating it.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow. If you need to execute custom reset logic have your flow call this method along with your own custom methods as part of a single action chain.
Parameters:
  context - the request context "success" if the reset action completed successfully
throws:
  Exception - if an exception occured
See Also:   FormAction.createFormObject(RequestContext)




setFormErrorsScope
public void setFormErrorsScope(ScopeType errorsScope)(Code)
Set the scope in which the Errors object will be placed. The default if not set is ScopeType.FLASH flash scope .



setFormObjectClass
public void setFormObjectClass(Class formObjectClass)(Code)
Set the form object class for this action. An instance of this class will get populated and validated. This is a required property if you register a validator with the form action ( FormAction.setValidator(Validator) )!

If no form object name is set at the moment this method is called, a form object name will be automatically generated based on the provided form object class using ClassUtils.getShortNameAsProperty(java.lang.Class) .




setFormObjectName
public void setFormObjectName(String formObjectName)(Code)
Set the name of the form object in the configured scope. The form object will be included in the configured scope under this name.



setFormObjectScope
public void setFormObjectScope(ScopeType scopeType)(Code)
Set the scope in which the form object will be placed. The default if not set is ScopeType.FLOW flow scope .



setMessageCodesResolver
public void setMessageCodesResolver(MessageCodesResolver messageCodesResolver)(Code)
Set the strategy to use for resolving errors into message codes. Applies the given strategy to all data binders used by this action.

Default is null, i.e. using the default strategy of the data binder.
See Also:   FormAction.createBinder(RequestContext,Object)
See Also:   org.springframework.validation.DataBinder.setMessageCodesResolver(org.springframework.validation.MessageCodesResolver)




setPropertyEditorRegistrar
public void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar)(Code)
Set a property editor registration strategy for this action's data binders. This is an alternative to overriding the FormAction.registerPropertyEditors(PropertyEditorRegistry) method.



setValidator
public void setValidator(Validator validator)(Code)
Set the validator for this action. When setting a validator, you must also set the FormAction.setFormObjectClass(Class) form object class . The validator must support the specified form object class.



setupForm
public Event setupForm(RequestContext context) throws Exception(Code)
Prepares a form object for display in a new form, creating it and caching it in the FormAction.getFormObjectScope() if necessary. Also installs custom property editors for formatting form object values in UI controls such as text fields.

A new form object instance will only be created (or more generally acquired) with a call to FormAction.createFormObject(RequestContext) , if the form object does not yet exist in the configured FormAction.getFormObjectScope() scope . If you want to reset the form handling machinery, including creation or loading of a fresh form object instance, call FormAction.resetForm(RequestContext) instead.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow. If you need to execute custom form setup logic have your flow call this method along with your own custom methods as part of a single action chain.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope" "success" when binding and validation is successful
throws:
  Exception - an unrecoverable exception occurs, eitherchecked or unchecked
See Also:   FormAction.createFormObject(RequestContext)




validate
public Event validate(RequestContext context) throws Exception(Code)
Validate the form object by invoking the validator if configured.

NOTE: This action method is not designed to be overidden and might become final in a future version of Spring Web Flow. If you need to execute custom validation logic have your flow call this method along with your own custom methods as part of a single action chain. Alternatively, override the FormAction.doValidate(RequestContext,Object,Errors) hook.
Parameters:
  context - the action execution context, for accessing and settingdata in "flow scope" or "request scope" "success" if there are no validation errors, "error" otherwise
throws:
  Exception - an unrecoverable exception occured, eitherchecked or unchecked
See Also:   FormAction.getValidator()




validationEnabled
protected boolean validationEnabled(RequestContext context)(Code)
Return whether validation should be performed given the state of the flow request context. Default implementation always returns true.
Parameters:
  context - the request context, for accessing and setting data in"flow scope" or "request scope" whether or not validation is enabled



Methods inherited from org.springframework.webflow.action.MultiAction
final protected Event doExecute(RequestContext context) throws Exception(Code)(Java Doc)
public MethodResolver getMethodResolver()(Code)(Java Doc)
public void setMethodResolver(MethodResolver methodResolver)(Code)(Java Doc)
final protected void setTarget(Object target)(Code)(Java Doc)

Fields inherited from org.springframework.webflow.action.AbstractAction
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.webflow.action.AbstractAction
public void afterPropertiesSet() throws Exception(Code)(Java Doc)
abstract protected Event doExecute(RequestContext context) throws Exception(Code)(Java Doc)
protected void doPostExecute(RequestContext context) throws Exception(Code)(Java Doc)
protected Event doPreExecute(RequestContext context) throws Exception(Code)(Java Doc)
protected Event error()(Code)(Java Doc)
protected Event error(Exception e)(Code)(Java Doc)
final public Event execute(RequestContext context) throws Exception(Code)(Java Doc)
protected String getActionNameForLogging()(Code)(Java Doc)
public EventFactorySupport getEventFactorySupport()(Code)(Java Doc)
protected void initAction() throws Exception(Code)(Java Doc)
protected Event no()(Code)(Java Doc)
protected Event result(boolean booleanResult)(Code)(Java Doc)
protected Event result(String eventId)(Code)(Java Doc)
protected Event result(String eventId, AttributeMap resultAttributes)(Code)(Java Doc)
protected Event result(String eventId, String resultAttributeName, Object resultAttributeValue)(Code)(Java Doc)
protected Event success()(Code)(Java Doc)
protected Event success(Object result)(Code)(Java Doc)
protected Event yes()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.