问题现象:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Tue Nov 03 15:13:43 CST 2020
There was an unexpected error (type=Not Found, status=404).
问题解决:
-
查看有没有添加 @RestController 注解,或者如果返回的是字符串,注解使用的是@Controller,没有添加@ResponseBody注解。
-
查看SpringBoot的启动类(类名上面有@SpringBootApplication注解 )与controller包在不在同一个目录下,如果不在,移动到同一目录下。
-
查看有没有写@GetMapping注解并添加访问路径。