版权声明:欢迎转载 https://blog.csdn.net/weixin_33387378/article/details/88424468
浪费我这么久。主要我返回的页面是html,在pom.xml中添加thymeleaf依赖就好了
@RequestMapping(value = "main",method = RequestMethod.GET)
public String toMain(){
return "main";
}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>