Sorry, Chris, I'm just getting started with Spring MVC, and I'm still not clear how to configure a single view to support multiple form controllers.
From my springapp-servlet.xml:
Code:
<bean id="form1Controller" class="Form1Controller">
<property name="sessionForm"><value>true</value></property>
<property name="commandName"><value>Form1Command</value></property>
<property name="validator"><ref bean="form1Validator"/></property>
<property name="formView"><value>myOnlyView</value></property>
<property name="successView"><value>form1Confirmation</value></property>
</bean>
<bean id="form2Controller" class="Form2Controller">
<property name="sessionForm"><value>true</value></property>
<property name="commandName"><value>Form2Command</value></property>
<property name="validator"><ref bean="form2Validator"/></property>
<property name="formView"><value>myOnlyView</value></property>
<property name="successView"><value>form2Confirmation</value></property>
</bean>
<bean id="form1Validator" class="Form1Validator"/>
<bean id="form2Validator" class="Form2Validator"/>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/myOnlyView.vm">form1Controller</prop>
</props>
</property>
</bean>
Obviously a couple of issues with this. The primary issue is that the url "/myOnlyView.vm" can only be mapped to one of the two form controllers. The other form controller is never activated ("activated" probably isn't the correct term here... but it doens't work, anyways, and from a lack of log messages it is never "activated").
Here is an example of the HTML that I would like to be able to somehow link up to one or more form controllers:
Code:
<html>
<head></head>
<body>
<form id="form1" action="get">
...
</form>
<form id="form2" action="get">
...
</form>
</body>
</html>
Hope that's clear. Thanks in advance.
Brian