@controller @requestMapping issues in resolving paths
Hello
First post ever at this site. Hopefully, I posted to the correct forum. My issue is that I am trying to map my @controller class @RequestMapping's to unique methods via params but have not been to successful! Below is my @controller class, snippet of web xml config file and snippet of jsp.
The end result is an error thrown at the server:
Any ideas would be appreciated... tried a bunch of different things and either I get a page with nothing on it or an error thrown by the springframework.
[10/19/12 11:19:16:274 EDT] 0000001e ErrorsTag E org.springframework.web.servlet.tags.RequestContex tAwareTag doStartTag Invalid property 'do?param1=edit' of bean class [com.servlet.ghesiForms.OpenResidentialAccountTenan tCommand]: Bean property 'do?param1=edit' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'do?param1=edit' of bean class [com.servlet.ghesiForms.OpenResidentialAccountTenan tCommand]: Bean property 'do?param1=edit' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
XML Snippet
<servlet-mapping>
<servlet-name>ghesiforms</servlet-name>
<url-pattern>/openResidentialAccountTenant.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ghesiforms</servlet-name>
<url-pattern>/openResidentialAccountTenant.do?param1=edit</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ghesiforms</servlet-name>
<url-pattern>/openResidentialAccountTenant.do?param1=confirmatio n</url-pattern>
</servlet-mapping>
_______
Controller class
@Controller
@RequestMapping("/openResidentialAccountTenant")
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, params = {"param1=edit"})
public String onSubmit(@ModelAttribute("openResidentialAccountTe nant") @Valid OpenResidentialAccountTenantCommand enquiry, BindingResult result){
System.out.println("in openResidentialAccountTenant POST");
if(result.hasErrors()){
return "openResidentialAccountTenant";
}
return "openResidentialAccountTenant_confirmation";
}
@RequestMapping(method=RequestMethod.POST, params = {"param1=confirmation"})
public String onConfirmationSubmit(@ModelAttribute("openResident ialAccountTenant") @Valid OpenResidentialAccountTenantCommand enquiry, BindingResult result){
System.out.println("in openResidentialAccountTenant POST");
if(result.hasErrors()){
return "alldone_confirmationShouldntHappen";
}
return "allDone_confirmation";
}
}
_______________________________
JSP
<form:form commandName="openResidentialAccountTenant.do?param 1=edit">
<div id="OpenResidentialAccountTenantForm" >
<h3><a href="#">Step 1 - Add Customer Information</a></h3>
<div id="customerInfo">
etc....etc...
<tr>
<td><br>
<input type="submit" value="Submit"/></td>
</tr>
</table>
</div>
</div>
</form:form>