MVC: Validation doesn't fire on form submission, but does upon returning to form.
Hi,
I'm using Spring MVC version 2.5.6.SEC01.
I have a controller configured to use a validator when the form is submitted.
Code:
<bean name="debitCardLostStolenController"
class="aib.cctp.ui.controller.cards.DebitCardLostStolenController">
<property name="sessionForm">
<value>true</value>
</property>
<property name="commandClass">
<value>aib.cctp.domain.model.api.cards.DebitCardReplace</value>
</property>
<property name="validator">
<ref bean="debitCardReplaceValidator"/>
</property>
</bean>
However, when I submit the form, the validation is not kicking in. The webapp displays the next screen, which is a confirmation screen showing all the data entered on the input screen.
The confirmation screen has a 'Back' button (<input> tag) that navigates back to the input screen by having
Code:
action="debitcardloststolen.htm?_target0=true" method="post"
If I click the 'Back' button, I'm brought back to the input screen, but now the validation runs, and any validation errors appear on the input screen.
Anyone got any ideas where I'm going wrong? This simple scenario is working fine on my other controllers. I'm sure it's something obvious, but I can't see it! :confused:
Many thanks for your help,
Ken.