无法使用来自crudRepository的findById方法更新表

时间:2018-10-02 12:04:30

标签: java spring-boot

我试图在春季启动时使用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

0 个答案:

没有答案