|
From: Keith D. <ke...@in...> - 2005-03-29 01:38:37
|
Hey guys,
I added more power to the multi-action implementation to spring web flow
this evening, for dispatching related controller logic to different methods
on a single target action object.
Essentially, you can now more flexibly map action states to handler methods,
so when a state is entered a specific target method will be invoked. This
lets the state definitions drive workflow - which are their strength - while
the action handlers concentrate on executing some processing and returning a
result.
For example, from Phonebook:
addActionState("bindAndValidateCriteria",
name(multiAction("person.Search.criteria.bindAndValidate"),
"bindAndValidate"),
new Transition[] {
on(error(), "viewCriteria"),
on(success(), "executeQuery")
});
The above reads "for the flow being built, add an action state with the id
'bindAndValidateCriteria'. Name the action 'bindAndValidate' and use the
multi-action implementation with bean id "person.Search.bindAndValidate"."
At runtime, when the above action state is entered, the selected
multi-action implementation will execute and dispatch to a single handler
method. The handler method to use will be resolved based on the assigned
name property above - in this case, "bindAndValidate". Arbitrary
properties are also supported, so you can store and act on whatever further
information you like about an action associated with a single action state.
We'll enhance the XML DTD to support arbitrary action state properties as
well.
Keith
Keith Donald
Interface21 - http://www.springframework.com
<http://www.springframework.com/> - Spring Training, Consulting and Support
- "From the Source"
|