I'm trying to configure a small aplication based on extjs asfrontend and Spring as backend. So to communicate with the server from extjs we need to configure proxy writer at store. My proxy configuration looks as follows:
proxy : {
type: 'rest',
reader: {
type: 'json',
idProperty: 'id',
root: 'data',
totalProperty: 'total',
successProperty: 'success',
messageProperty: 'message'
},
writer: {
type: 'json',
allowSingle: true,
writeAllFields: true,
root: 'data'
},
api: {
read: 'countries',
create: 'country/add',
update: 'country/update',
destroy: 'country/delete'
}
}
And here is the @RequestMapping in a Spring Controller:
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = COUNTRY_PATH + DELETE_PATH + SLASH + DELETE_ID_PARAM, method = RequestMethod.DELETE)
public void delete(@PathVariable(DELETE_ID_PARAM) Integer deleteId, @RequestParam Object data) {
System.out.println(data.toString());
countryService.deleteCountry(deleteId);
}
Tomcat answers everytime "400 Bad request" with description "The request sent by the client was syntactically incorrect."
So, but if I change proxy type to ajax and requestMapping to getting POST requests everything works fine.