Expert Spring MVC and Web Flow

(Dana P.) #1

Listing 11-15./WEB-INF/flow.xmlIncluding All Available Flows


<bean name="flowRegistry"
class="org.springframework.webflow.registry.XmlFlowRegistryFactoryBean">




If needed, flow definitions may also be explicitly assigned identifiers and additional, cus-
tom properties when registered.


Additional Configuration


A FlowControllerplus a FlowRegistryare the only required deployment artifacts for executing
flow definitions within a Spring MVC environment. If you need more power—for example, you
wish to control the way in which flow executions are stored or observe the life cycle of certain
flows—there are additional objects that may be configured, but that configuration is entirely
optional.


■Tip Spring Web Flow provides meaningful defaults, but still gives you the power to customize and extend
when you need to. You’ll learn how to configure more advanced options in Chapter 12.


View Template Resolution


There is still one important topic that we have not yet discussed: How are logical view names
selected by view states translated to physical view templates that render responses? The
answer is Spring MVC’s built-in ViewResolverinfrastructure. Spring Web Flow does not care
for this concern; as a controller framework, it simply makes logical view selections. It is the job
of the calling framework (i.e., Spring MVC) to care for mapping those logical view selections to
renderable templates.


View Template Requirements


There are a few requirements placed upon view templates that participate in flow executions.
It should be noted however, that there are not many, and they do not prevent views from being
used “outside” a web flow environment.


•To signal an event in an executing flow, the view must submit back a parameter
that associates the request with the correct flow execution. By default, this is the
_flowExecutionIdparameter.

•To tell the flow what user event occurred, the view must submit back a parameter that
identifies the event. By default, this is the _eventIdparameter.

CHAPTER 11 ■INTRODUCTION TO SPRING WEB FLOW 331
Free download pdf