I am sending my request using jquery ajax with type DELETE. On the server side, I have a suitable descriptor method that looks like this:
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public String delete(@RequestParam("hotel") String hotelCode, @PathVariable Long id, Model model){
//delete operation
return "redirect:/HotelTaxesAndCharges?hotel="+hotelCode;
}
and the method to which I want to redirect my call after deletion is as follows
@RequestMapping(method = RequestMethod.GET)
public String getAll(@RequestParam("hotel") String hotelCode, Model model){
return 'getAll';
}
therefore, when I call the delete method at runtime, I get the error "you can redirect to JSP using only the GET PUT or HEAD methods". I found a solution using HiddenHttpMethodFilter, but the result code looks a bit dirty, and I need to send a request using POST and add an additional parameter (_method) to request it using a custom request type.
So, I have a question, is there any other solution for converting DELETE / REDIRECT / GET.
UPDATE

delete. , delete , :
