課程
/后端開發
/Java
/2小時學會Spring Boot
為啥我的返回的是 index .....
2017-11-27
源自:2小時學會Spring Boot 4-1
正在回答
雄心部署下
正解 ?index頁面只留<h1>hello Spring Boot </h1> 別的都刪掉,因為是用了模板
html頁面中只寫<h1>hello Spring Boot </h1>
其他的都刪了
izunqian
請問你的問題解決了嗎? 我用樓上的試了還是不行
有一個昵稱
第一需要使用
?<dependency>
? ? ? ? ? ? <groupId>org.springframework.boot</groupId>
? ? ? ? ? ? <artifactId>spring-boot-starter-thymeleaf</artifactId>
? ? ? ? </dependency>
這個maven依賴
第二需要去掉之前加在對于映射方法上的注解@RequestBody
或是將@RestController替換成@Controller
PS:我在使用thymeleaf這個模板插件的時候遇到無法啟動的錯誤,解決方案是:
將pom文件的<properties>標簽內加上thymeleaf的版本參數
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
? ?<thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version>
舉報
Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-01-16
雄心部署下
2017-12-19
正解 ?index頁面只留<h1>hello Spring Boot </h1> 別的都刪掉,因為是用了模板
2017-12-08
html頁面中只寫<h1>hello Spring Boot </h1>
其他的都刪了
2017-12-05
請問你的問題解決了嗎? 我用樓上的試了還是不行
2017-11-28
第一需要使用
?<dependency>
? ? ? ? ? ? <groupId>org.springframework.boot</groupId>
? ? ? ? ? ? <artifactId>spring-boot-starter-thymeleaf</artifactId>
? ? ? ? </dependency>
這個maven依賴
第二需要去掉之前加在對于映射方法上的注解@RequestBody
或是將@RestController替換成@Controller
PS:我在使用thymeleaf這個模板插件的時候遇到無法啟動的錯誤,解決方案是:
將pom文件的<properties>標簽內加上thymeleaf的版本參數
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
? ?<thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version>