升级 spring 3.0 前要准备的一些工作

 

0:

清除掉所有的对 spring framework 低版本 的 显示引用。

 

1,  javax –> j2ee

image

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
</dependency>

2,

import org.thymeleaf.spring5.SpringTemplateEngine;

->

import org.thymeleaf.spring6.SpringTemplateEngine;

 

3,

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

->

import org.springframework.web.servlet.HandlerInterceptor;

..
extends HandlerInterceptorAdapter =>implements HandlerInterceptor

 

4,

spring.redis.* => spring.data.redis.*

 

5,

mybatis-spring-boot-starter --> 3.0.1

6,

<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>9.2.0.jre8</version>
</dependency>

升级 11.2.2.jre17  还需要考虑,会导致SSL 错误

解决:jdbc:sqlserver://ipipip:1433;DatabaseName=dbname;encrypt=false;

7,   兼容 url/a 与 url/a/

@Configuration
public class TrailingSlashWebConfiguration implements WebMvcConfigurer {

@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseTrailingSlashMatch(true);
}
}


8, META-INF/spring.factories   ->  META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

参考:

1, 重点 Url /

https://www.51cto.com/article/741992.html 

2, https://www.cnblogs.com/ilovejaney/p/16931780.html

3, javax https://www.51cto.com/article/740704.html

posted @ 2023-01-03 15:49  张保维  阅读(156)  评论(0编辑  收藏  举报