ExtJS POST请求客户端服务端案例

阅读更多
客户端GUI端示例
var positionIDList = [1,2,3,4];
Ext.Ajax.request({
	method: 'POST',
    url: 'services/test',
    jsonData: {
    	'positionIDList':positionIDList,
    	'date':'20151110'
    },
    writer:'json',
    success: function(response, opts) {
        var obj = Ext.decode(response.responseText);
    },
    failure: function(response, opts) {
    	console.log('Operation failure');
    }
});


服务端RESTful方法示例:
@POST
@Path("/test")
public int test(LinkedHashMap params) {
	String date = (String) params.get("date");
	List> positionIDRawList = (List>) params.get("positionIDList");
}

你可能感兴趣的:(extjs,post,请求,rest,restful)