背景:没学过前端,现在需求写个网页项目,然后突击学习了一下。测试连接数据库已经可以连接,test时数据断点也看到都是正确的,但是在尝试将数据返回前台时发生了如下错误,麻烦各位有经验的指点一下,具体错误如下:
Controller如下图:
运行报错:
后台报错截图:
2021-08-30 17:13:00.064 ERROR 11784 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
2021-08-30 17:13:00.329 ERROR 11784 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template [favicon.ico], template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [favicon.ico], template might not exist or might not be accessible by any of the configured Template Resolvers
Impl源码:
前端html代码:
尝试将 “ return userListService.findData(page, limit);”的 page手动赋值1000,limit赋值20:
重新运行后发现不报错,但是JSON数据为空:
vo写了个toString:
后台发现赋值没成功,全部为空: