Because using DWZ's lookup function, the value of the callback is xxx.xxvalue from the name, and I have some form data that is not prefixed with the name, and the default binding is problematic for SPRINGMVC background bindings. This is the need to use the Initbinder annotation feature
1 @InitBinder ("Bannerinfo") 2public void initBinder1 ( Webdatabinder binder) { 3 binder.setfielddefaultprefix ("Bannerinfo.") ); 4
1 @RequestMapping (value = "/add", method = requestmethod.post)23 public String Add (@ModelAttribute ("Bannerinfo"4 //.....) 5 }
1 <formMethod= "POST"Action= "${contextpath}/banner-info/add"class= "Required-validate pageform"onsubmit= "Return Validatecallback (this, dialogreloadnavtab);">2 <label>Field name</label>3 <inputtype= "text"name= "Bannername" />4 <label>Related number</label>5 <inputtype= "text"name= "Bannerinfo.code" />6 <inputtype= "Submit"value= "Submit" />7 </form>
Reference:
http://jinnianshilongnian.iteye.com/blog/1888474
SPRINGMVC Accurate Data binding