前端代码
$.ajax({
type: "post",
url: baseUrl + "handleSubmit",
data: JSON.stringify(self.search),
contentType: 'application/json',
dataType: "json",
success: function (data) {
console.log(data)
},
error: function (error) {
console.log('request failed', error);
}
});
Java后端代码
@PostMapping(value = "handleSubmit")
public Map handleSubmit(@RequestBody Entity entity) {
Map m = new HashMap();
m.put("entity",entity);
return m;
}