I send my request using jquery ajax with type "DELETE". At server side I have approprite handle 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 method to which I want to redirect my call after delete looks like this
@RequestMapping(method = RequestMethod.GET)
public String getAll(@RequestParam("hotel") String hotelCode, Model model){
//logic
return 'getAll';
}
so when i call delete method during execution I'm getting error "you can redirect to JSP using only GET PUT or HEAD methods". I found solution using HiddenHttpMethodFilter, but result code looks little messy and I need to send request using POST and adding additional parameter (_method) to requst with custom request type.
So my question is there any other solution for DELETE/REDIRECT/GET transformation.
SORRY FOR BAD ENGLISH
UPDATE
so you can that it redirects using delete too. And if I change everything from delete to post I get this: