Client-side reference to server
var url= "<m:url value= '/countsendlog/toshow.do '/>?unitid=" + Unitid + "&begintime=" + $ ("#begintime"). Val () + "&endtime=" + $ ("#endtime"). Val ();
Parent.addtab (' detail interface ', url, ' ', true, ');
1 , service-pass parameters to the client
@RequestMapping ("/toshow")
Public Modelandview toshow (string Unitid, String begintime,
String endtime) {
Modelandview m = new Modelandview ("Jsp/yun/yun"); Default omitted. jsp
Define HASHMAP Key-value pairs
map<string,string> map = new hashmap<string,string> ();
Map.put ("Unitid", Unitid);
Map.put ("BeginTime", begintime);
Map.put ("Endtime", Endtime);
M.addobject ("map", map);
return m;
}
2 , client hidden domain receive:
${map.unitid} form, direct receive using service-side parameters
<input type= "text" name= "Unitid" id= "Unitid" Value=${map.unitid}/>
<input type= "text" name= "BeginTime" id= "BeginTime" Value=${map.begintime}/>
<input type= "text" name= "Endtime" id= "Endtime" value=${map.endtime} />
3 , the client jquery method is passed to the server:
Serialization of
Serializegriddata:function (postdata) {//Add query condition value
var obj = {};
obj["Unitid"] = $ ("#unitId"). Val ();
obj["BeginTime"] = $ ("#begintime"). Val ();
obj["Endtime"] = $ ("#endtime"). Val ();
$. Extend (True,obj,postdata);
return obj;
}
4 , the service side receives:
Client pass-through, automatically mapped to the corresponding field of the entity class:
public void Getsendcountdetails (countsendlog countsendlog, httpservletrequest request,
HttpServletResponse Response, page page) {
Countsendlog entity class receive, field corresponding parameter name Unitid,begintime,endtime
String Unitid = Countsendlog.getunitid ();//Acquired
Finish
Spring client JSP and server-side interaction method