Hi All,
I try to send an array of json object to the server:
Code:
Ext.Ajax.request({
url: '../rest/admin/group/',
method: 'PUT',
headers: {'Content-Type': 'application/json'},
params: {
sorts: Ext.JSON.encode([{"property":"name","direction":"ASC"}])
},
success: function(response) {
...
}
});
The server uses Spring MVC to handle the request:
Code:
binder.registerCustomEditor(Sort.class, new JsonPropertyEditor(Sort[].class));
...
@RequestMapping(value = "/group", method = RequestMethod.PUT)
public View removeUsers4Group(Model model,
@RequestBody Sort[] sorts) {
...
}
I get the 404 error (bad request) and the request never reaches the handler. However, if it is a request param, the object get parsed correctly:
Code:
@RequestParam(value = "sort", required = false) final Sort[] sorts, Model model) {
I am using extjs 4.1.1a. Any help will be appreciated.
Thanks,
-ZJ