java - mapping data member with diffrent name in @ModelAttribute -


customer class:

public class customer {     private string custname;     private string custfirstname;     private string custmiddlename;     private string custlastname; } 

jsp:

<form:input mandatory="true" id="custnametxt" path="custname"             cssclass="txtfield controlwidth" readonly="false" />         

if path="cname"

<form:input mandatory="true" id="custnametxt" path="cname"             cssclass="txtfield controlwidth" readonly="false" />         

then how i'll map cname parameter customer class object in spring

controller:

@requestmapping(value = "/addcustomer.do", method = requestmethod.post) public modelandview addcustomer(@modelattribute("customer") customer customer1,                                 httpservletrequest request, httpsession session) 


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -