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

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

加入spring-boot-starter-web的話@Configuration路由無法生效

<parent>
????<groupId>org.springframework.boot</groupId>
????<artifactId>spring-boot-starter-parent</artifactId>
????<version>2.1.0.BUILD-SNAPSHOT</version>
</parent>
<repositories>
????<repository>
????????<id>spring-snapshots</id>
????????<name>Spring?Snapshots</name>
????????<url>https://repo.spring.io/libs-snapshot</url>
????????<snapshots>
????????????<enabled>true</enabled>
????????</snapshots>
????</repository>
</repositories>

之前我沒有加入spring-boot-starter-web依賴的時候

https://img1.sycdn.imooc.com//5aea85e600017c3d08910220.jpg

是可以訪問到

https://img1.sycdn.imooc.com//5aea861c0001fe4608410213.jpg

這個路由的

但是加上

<dependency>
????<groupId>org.springframework.boot</groupId>
????<artifactId>spring-boot-starter-web</artifactId>
</dependency>

這個依賴之后

https://img1.sycdn.imooc.com//5aea866c00015edf08570282.jpg

就沒有@Configuration配置的路由了,也訪問不到,只能訪問到@RestController

這是版本的問題嗎?還是我哪里配置錯了

正在回答

3 回答

同問,為什么Tomcat不行

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

使用spring-boot-starter-web模塊后,默認使用Netty容器吧

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

使用spring-boot-starter-web模塊后,默認使用了tomcat容器

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

成佛的小兔幾 提問者

問題是Tomcat為什么不行
2018-05-29 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

加入spring-boot-starter-web的話@Configuration路由無法生效

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

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

幫助反饋 APP下載

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

公眾號

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