So i have the following problem. I have a controller which i mapped to "/reservationQuery/*". Whenerver i go on the url for "delete_1" method, it works, but whnever i try and go on the "delete_2" method it says that there was no mapping for that URI. But why does that happen? Shouldn all URI beggining with /reservationQuery/ be mapped by my ReservationQueryController?
And if i want to use the second URI for deletion, do i have to make another controller and map it to /reservationQuery/delete/* ?
@Controller
@RequestMapping("/reservationQuery/*")
public class ReservationQueryController{
private ReservationService reservationService;
@Autowired
public ReservationQueryController(ReservationService reservationService) {
this.reservationService = reservationService;
}
@RequestMapping(value="/reservationQuery/{reservationID}", method=RequestMethod.GET)
public String delete_1(@PathVariable("reservationID") int reservationID, Model model){
reservationService.deleteReservation(reservationID);
return "reservationQuery";
}
@RequestMapping(value="/reservationQuery/delete/{reservationID}", method=RequestMethod.GET)
public String delete_2(@PathVariable("reservationID") int reservationID, Model model){
reservationService.deleteReservation(reservationID);
return "reservationQuery";
}
}