将实体映射名称从“/index”更改为“/indexemploye”并收到此错误
changed the entity mapping name from "/index" to "/indexemploye" and got this error
我已将浏览器和 IDE 控制台的错误日志保存到下面的这 2 个 pdf 文件中:
代码库(源代码link):https://github.com/ismailalabou/service-mvc.git
Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "currentPage==status.indexemploye" (template: "employes" - line 44, col 11)
看起来查找和替换出错了。
我认为您在 DB 或 spring-data-jpa 中没有任何问题。
百里香叶引起的。我似乎没有在您想要在 thymeleaf 中使用的模型中添加任何 indexemploye 对象。
您可以在模型中添加对象,如:
@GetMapping("/showPost/{id}")
public String showPost(@PathVariable(value = "id") long id, Model model) {
Post post = postService.getPostById(id);
postService.generateTagsString(post);
model.addAttribute("post", post); // Now object Post can accessed in thyemeaf with name post
return "show_post";
}
我已将浏览器和 IDE 控制台的错误日志保存到下面的这 2 个 pdf 文件中:
代码库(源代码link):https://github.com/ismailalabou/service-mvc.git
Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "currentPage==status.indexemploye" (template: "employes" - line 44, col 11)
看起来查找和替换出错了。
我认为您在 DB 或 spring-data-jpa 中没有任何问题。 百里香叶引起的。我似乎没有在您想要在 thymeleaf 中使用的模型中添加任何 indexemploye 对象。 您可以在模型中添加对象,如:
@GetMapping("/showPost/{id}")
public String showPost(@PathVariable(value = "id") long id, Model model) {
Post post = postService.getPostById(id);
postService.generateTagsString(post);
model.addAttribute("post", post); // Now object Post can accessed in thyemeaf with name post
return "show_post";
}