Expert Spring MVC and Web Flow

(Dana P.) #1
Figure 12-3.Conversion of a ViewSelection to a View

There are two implementations of ViewSelector provided out of the box, shown in
Table 12-10.

Table 12-10.ViewSelector Implementations
Name Behavior Model Exposed
org.springframework.webflow. Represents a redirect view. Only exposes parameters
support.RedirectViewSelector explicitly specified in the
redirect Expression(e.g.,
redirect:/url.htm?param0=$
{flowScope.foo}¶m1=value1).
org.springframework. Refers to a static view name. Exposes all data in both
webflow.support. flow and request scope
SimpleViewSelector data in the model.

The FlowBuilderdecides which ViewSelectorto use based upon the value of the view
property. Table 12-11 describes the criteria Spring Web Flow uses to choose a ViewSelector.

Table 12-11.ViewSelector Selection
ViewSelector Criteria
RedirectViewSelector If the viewNamecontains a redirect: prefix.
YourViewSelector If the viewNameis bean:YourViewSelector.
SimpleViewSelector If none of the other two conditions are met.

Indicating Transitions
When Spring Web Flow encounters a view state it will

1.render the view;

2.pause the flowExecution;

3.wait for a user-supplied eventIdto resume.

Web Framework
(Servlet, JSF,
Portlet)

ViewSelection

Spring Web Flow Engine

FlowExecutionManager

364 CHAPTER 12 ■ADVANCED SPRING WEB FLOW

Free download pdf