欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

Tomcat 10大坑警告:并非所有更新都是好事(Tomcat 9及以下足够使用)

最编程 2024-08-07 17:26:25
...

部分转自于: https://blog.****.net/m0_52765092/article/details/115307947 

 

tomcat版本和jdk版本的对应, 或者可以自己直链去看: https://tomcat.apache.org/whichversion.html

 

 

tomcat的版本也不易太老,否则会导致理论和实际不相适应: (尽量使用tomcat 8.x、tomcat 8.5、tomcat 9)

 

 

 

 

Tomcat10巨坑
结 论 : t o m c a t 9 和 t o m c a t 10 的 依 赖 包 不 是 同 一 个 。 \color{#FF3030}{结论:tomcat9和tomcat10的依赖包不是同一个。}结论:tomcat9和tomcat10的依赖包不是同一个。

tomcat9的包名以javax开头:javax.*

 

t o m c a t 10 的 包 名 更 改 为 : j a k a r t a . ∗ \color{#FF3030}{tomcat10的包名更改为:jakarta.*}tomcat10的包名更改为:jakarta.∗

 

官网说名:
Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from j a v a x . ∗ \color{#FF3030}{javax.*}javax.∗toj a k a r t a . ∗ \color{#FF3030}{jakarta.*}jakarta.∗. This will almost certainly require code changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later. A migration tool is under development to aid this process.

而且tomcat10在结合springMVC使用时,DispatcherServlet在配置时会报错。
现在(2021年3月30日)DispatcherServlet导的包:

软件不是越新越好。