加入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依賴的時候
是可以訪問到
這個路由的
但是加上
<dependency> ????<groupId>org.springframework.boot</groupId> ????<artifactId>spring-boot-starter-web</artifactId> </dependency>
這個依賴之后
就沒有@Configuration配置的路由了,也訪問不到,只能訪問到@RestController
這是版本的問題嗎?還是我哪里配置錯了
2019-06-12
同問,為什么Tomcat不行
2018-12-19
使用spring-boot-starter-web模塊后,默認使用Netty容器吧
2018-05-18
使用spring-boot-starter-web模塊后,默認使用了tomcat容器