Table 12-9.FormAction Coarse-Grained Methods
Method Purpose Life Cycle
setupForm() Calls exposeFormObject, but Before the form is displayed.
also performs data binding
(if bindOnSetupFormis true).
bindAndValidate() Performs binding and validation After the form has been submitted.
of the form object.
As mentioned in Chapter 11, you would typically require these methods to be executed
before and after a form view is displayed. Listing 12-21 shows how to do this.
Listing 12-21.Spring Web Flow Fragment Showing Entry and Exit Actions on a View
As in Listing 12-19, you could break up each of the steps into distinct states. This is a little
more verbose, but more clearly demarcates the different steps. It also provides greater flexibil-
ity, allowing you to reenter a state definition from a different point within the flow. Listing 12-22
shows this approach.
Listing 12-22.Spring Web Flow Fragment Showing Form Management in Explicit States
CHAPTER 12 ■ADVANCED SPRING WEB FLOW 361