Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
3rd version of ReservationController with Exception Handler
public class ReservationController {
private ReservationService reservationService;
public ReservationController(ReservationService reservationService) {
this.reservationService = reservationService;
@RequestMapping(method = RequestMethod.GET, value = "/{name}")
private Reservation getReservation(@PathVariable String name) {
System.out.println("Entering and leaving ReservationController : getReservation after fetching service");
return reservationService.getReservationDetails(name);
public void userNotFoundHandler(ReservationNotFoundException rnfe) {
System.out.println("Entering and leaving ReservationController : userNotFoundHandler");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.