亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為啥我的返回是index

為啥我的返回的是 index .....

正在回答

5 回答

雄心部署下

0 回復 有任何疑惑可以回復我~

正解 ?index頁面只留<h1>hello Spring Boot </h1> 別的都刪掉,因為是用了模板

0 回復 有任何疑惑可以回復我~

html頁面中只寫<h1>hello Spring Boot </h1>

其他的都刪了

0 回復 有任何疑惑可以回復我~
#1

izunqian

親測和這個沒關系. 1.加上視頻中提到的依賴 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>' 2.將HelloController類上面的@RestController替換為@Controller
2018-08-14 回復 有任何疑惑可以回復我~

請問你的問題解決了嗎? 我用樓上的試了還是不行

0 回復 有任何疑惑可以回復我~
#1

有一個昵稱

剛查了一下 htm頁面有錯
2017-12-06 回復 有任何疑惑可以回復我~

第一需要使用

?<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>


1 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
2小時學會Spring Boot
  • 參與學習       151526    人
  • 解答問題       1132    個

Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序

進入課程

為啥我的返回是index

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號