Springmvc the same field parameter delivery solution for multiple objects, sometimes it is necessary to pass multiple objects in SPRINGMVC 3
No support for struts2-like rules of point syntax in SPRINGMVC
use a bridge connection to encapsulate different sections specifically into one object
(recommended)
Advantages: reduced conflict and reduced workload
Cons: Conflicting fields/total fields approaching 1 o'clock is not necessary (however, this is rarely the case, unless it is an inheritance relationship, but the inheritance can use the subclass to pass the value, so this problem you have not encountered)
<form method= ' post ' action= ' URL ' >User name<input type= ' text ' name= ' u_name ' >User ID<input type= ' text ' name= ' u_id ' >Food Name<input type= ' text ' name= ' f_name ' >Food ID<input type= ' text ' name= ' f_id ' > <input type= ' text ' name= ' gender ' > <input type= ' text ' name= ' age ' > < Input type= ' text ' name= ' price ' > <input type= ' text ' name= ' date ' ></form>-----Create a JavaBean field specifically for conflicting fields PublicString ufbridge{PrivateString uname; PrivateString uid; PrivateString fname; PrivateString FID;}--------------------------@requestMap (Value={'/order/book '}) Publicstring Show (User u,food F,ufbridge ufb) {u.setname (Ufb.getuname ()); F.setname (Ufb.getuname ()); U.setid (UFB.GETUID); F.setid (Ufb.getfid);}
Reprinted from: https://my.oschina.net/ososchina/blog/344174
Springmvc passing parameters of the same name