嗨,谁能告诉我如何在休息消耗方法中处理这个 json
在我的客户端我有这个代码:
var search_form_data_array = new Object();
search_form_data_array[0] = JSON.stringify({name: "dept",
type:"equal",
value: "233"});
search_form_data_array[1] = JSON.stringify({ name: "deptDesc",
type:"equal",
value:"depts" });
$.ajax({
url: globalvars.otherDiscoveredSearchFormUri,
type:'POST',
data:{"SearchFormInput":search_form_data_array},
contentType:'application/json',
success: function(){}
});
我的服务器端代码:
@POST
@Path("/SearchForm")
@Consumes(MediaType.APPLICATION_JSON)
public String getOtherChargesSerachData(SearchFormInput data)
return data.name;
}
public static class SearchFormInput {
public String name;
public String type;
public String value;
}