1.項目配置
application.properties
1 #thymelea模板配置 2 spring.thymeleaf.suffix=.html 3 spring.thymeleaf.mode=HTML5 4 spring.thymeleaf.encoding=UTF-8 5 spring.thymeleaf.servlet.content-type=text/html
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
PageController.java
@Controller
public class PageController{
@RequestMapping("/index")
public String index(){ return "indexs";
}
}
2.項目結構

然后如果出現404或者505的話
有可能是maven引入的包有問題導致的
IDEA解決方案
右鍵項目 -》 找到Maven -》 選擇Reimport即可,然后重啟
eclipse構建的時候讓maven重新下載所需jar包才可以。
