gwt设置数据传送方式
String url = "/servlet/Myservlet";
url = URL.encode(url);
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
rb.setHeader("Content-Type", "text/xml");
Document doc = XMLParser.createDocument();
Element addE1 = doc.createElement("add");
doc.appendChild(addE1);
Element aE1 = doc.createElement("title");
aE1.appendChild(doc.createTextNode(s1));
addE1.appendChild(aE1);
CDATASection cs = doc.createCDATASection(s2);
Element bE1 = doc.createElement("context");
bE1.appendChild(cs);
addE1.appendChild(bE1);
try {
rb.sendRequest(doc.toString(), new myRequestCallback());
System.out.println(doc.toString());
} catch (RequestException e1) {
e1.printStackTrace();
}