@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.

  • I think the change of base has nothing to do with it - Roman Danilov
  • What is wrong then? - Artem Boyko
  • You have something wrong with ViewResolver. The error text suggests that it tries the string "index", which is returned by the index method. pass on to the same method. - Sergey Gornostaev

0