@RequestMapping("/record_by_id/{id}") public String index(@PathVariable Long id, Model model){ model.addAttribute("TB",this.telephoneBookService.findById(id)); return "index"; } In the log writes:
2017-10-29 11:54:28.340 WARN 3292 --- [nio-8080-exec-1] .wsmsDefaultHandlerExceptionResolver : Failed to bind request element: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type [java.lang.String] to required type [java.lang.Long]; nested exception is java.lang.NumberFormatException: For input string: "index" Previously, it worked using h2 database, when it changed to a mysql server, it stopped, but everything else works, for example with the @ResponceBody annotation in the browser, it displays all the rules, but if I just want to return the html page - varn.
indexmethod. pass on to the same method. - Sergey Gornostaev