This application has no explicit mapping for /error, so you are seeing this as a fallback.报错解决

 springBoot报错是这样的

解决办法:

方法一:类使用@RestController注解 

方法二:使用与 @RestController效果一样的@Controller加 @ResponseBody

然后就能正常访问页面

第二个bug :return “index”,页面会出现index字符串,而不是index.html,当时写法是这样

解决办法一:

解决办法二:

如果对你有用的话,可以点个赞,让更多为bug苦恼的人看到这文章,谢谢!

猜你喜欢

转载自blog.csdn.net/a66666_/article/details/107463711