对比spring boot的配置文件
spring boot 2.2.1
该版本的spring-boot-starter-web中有如下引用
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.2.1.RELEASE</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>tomcat-embed-el</artifactId>
<groupId>org.apache.tomcat.embed</groupId>
</exclusion>
</exclusions>
</dependency>
spring boot 2.3
该版本没有上面的应用,要想使用校验功能需要另外导入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
本文对比了SpringBoot 2.2.1与2.3版本中关于spring-boot-starter-web依赖项的变化,特别是在校验功能上的配置差异。2.2.1版本中,校验功能直接包含在web启动器中,而2.3版本则需要单独引入spring-boot-starter-validation依赖。

2627

被折叠的 条评论
为什么被折叠?



