Hi Marten
Thanks for all your help...
Just for others, here is my final code that is now working:
Code:
FIRST JSP
<form:form commandName="openResidentialAccountTenant">
<div id="OpenResidentialAccountTenantForm" >
<h3><a href="#">Step 1 - Add Customer Information</a></h3>
<div id="customerInfo">
<table border="0" cellpadding="0">
<tr>
<td><b>Customer Information</b></td>
</tr>
etc..
<tr>
<td><br>
<input type="submit" name = "editit" value = "editit" /></td>
</tr>
</table>
</div>
</div>
</form:form>
SECOND JSP snippet
<form:form commandName="openResidentialAccountTenant.do">
<div id="submitInfo">
<table border="0" cellpadding="0">
<tr>
<td><br/>
<input type="submit" value="Everything looks okay, please submit" name = "confirmit" value = "confirmit" />
</td>
</tr>
</table>
</div>
</form:form>
_____________________________________
Controller:
package com.servlet.ghesiForms;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/*
* Configure the class as an MVC controller
*
* Configure the class to process the url "/enquiry"
*/
@Controller
@RequestMapping("openResidentialAccountTenant.do")
public class OpenResidentailAccountTenantController{
@RequestMapping(method=RequestMethod.GET)
public String setupForm(ModelMap model){
System.out.println("in openResidentialAccountTenant GET");
OpenResidentialAccountTenantCommand openResidentialAccountTenant = new OpenResidentialAccountTenantCommand();
model.addAttribute("openResidentialAccountTenant", openResidentialAccountTenant);
return "openResidentialAccountTenant";
}
@RequestMapping(method=RequestMethod.POST)
public String onSubmitTest(@ModelAttribute("openResidentialAccountTenant") @Valid OpenResidentialAccountTenantCommand enquiry, BindingResult result){
System.out.println("in openResidentialAccountTenant Test POST");
if(result.hasErrors()){
System.out.println(result.getAllErrors());
return "openResidentialAccountTenant";
}
return "openResidentialAccountTenant_confirmation";
}
@RequestMapping(method=RequestMethod.POST, params = "editit")
public String onSubmitEdititParams(@ModelAttribute("openResidentialAccountTenant") @Valid OpenResidentialAccountTenantCommand enquiry, BindingResult result){
System.out.println("in openResidentialAccountTenant editit POST");
if(result.hasErrors()){
System.out.println(result.getAllErrors());
return "openResidentialAccountTenant";
}
return "openResidentialAccountTenant_confirmation";
}
@RequestMapping(method=RequestMethod.POST, params = "confirmit")
public String onConfirmationSubmit(@ModelAttribute("openResidentialAccountTenant") @Valid OpenResidentialAccountTenantCommand enquiry, BindingResult result){
System.out.println("in onConfirmationSubmit confirmation POST ");
if(result.hasErrors()){
return "alldone_confirmationShouldntHappen";
}
return "allDone_confirmation";
}
//
}
_______________________________
XML configuration file
<servlet-mapping>
<servlet-name>ghesiforms</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
Key here is that the submit button name value pair is providing the uniqueness required for the correct mapping to the corresponding request mapping params values.