Ajax synchronization requests generally look like this:
var conn = Ext. lib.Ajax.getConnectionObject().conn;
conn.open("POST", 'http://localhost:8080/struts2study/TreeDDGet?node=-1',false);
/ / The conn object here is actually the xmlHttpRequest object.
conn.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
conn.send("start=" 0 "&limit= " 30 );
var rootJson = conn.responseText;
General parameters can be passed through the url followed by the background. However, you can also send parameters when you see the send parameter. I tried it on the server side. The parameters sent cannot be accepted. In Firebug, I see that the post part of the request sent is a string, which does not look like the parameters sent normally. After searching for a long time, I still couldn't find a method. Later I found an article that introduced the explanation of the send method of the xmlHttpRequest object, and then I realized that I need to set a header attribute Content-Type to tell the server to send data in form, and then the parameter string in the send method will be Interpreted by the server.