我试图在春季启动时使用crudRepository更新我的条目,控制器代码为:
@RequestMapping("/edit-booking")
public String updateBooking(@RequestParam int id,HttpServletRequest request) {
request.setAttribute("bookings", bookingService.editBooking(id));
request.setAttribute("mode", "MODE_UPDATE");
return "Administrator";
}
在服务中
public Booking editBooking(int id) {
return bookingRepository.findById(id).orElse(null);
}
我收到此错误-
This application has no explicit mapping for /error, so you are seeing this as a fallback.
here was an unexpected error (type=Not Found, status=404).
No message available