I've got my own AbstractViewController that has a property (associatedFormController) that can be injected by Spring with the form controller that will be called on submission of that page. I then have an AbstractFormController that exposes a createFormBackingObject method that the view controller can call to initialise it and store it in the request. All my form and view controllers then extend these abstract controllers.
Thus my context XML can contain something like this:-
Code:
<bean id="deliveryAddressViewController" class="org.xxx.xxxx.controller.DeliveryAddressViewController">
<property name="associatedFormController">
<ref bean="deliveryAddressFormController"/>
</property>
</bean>
<bean id="deliveryAddressFormController" class="org.xxx.xxxx.controller.DeliveryAddressFormController">
<property name="commandName"><value>deliveryAddressCommand</value></property>
<property name="commandClass"><value>org.xxx.xxxx.command.DeliveryAddressCommand</value></property>
<property name="sessionForm"><value>true</value></property>
<property name="formView"><value>secure/checkout/deliveryAddress</value></property>
<property name="successView"><value>/secure/checkout/summary</value></property>
</bean>
Bob