migrate from javax.servlet to jakarta.servlet namespace#1620
Open
qinerg wants to merge 1 commit into
Open
Conversation
javax.* 命名空间属于已停止维护的 Java EE 规范,Eclipse 基金会于 2020 年将Java EE 迁移至 Jakarta EE,所有后续版本(Tomcat 10+)均采用 jakarta.* 命名空间。继续使用 javax.servlet 无法在主流应用服务器下运行,且存在安全漏洞无法修补的风险。 ## 改动范围(最小化原则) 本次迁移严格遵循最小化改动原则,仅做命名空间替换,不涉及任何业务逻辑变更: - pom.xml: javax.servlet-api:3.1.0 → jakarta.servlet-api:5.0.0, Jetty 9.4.x → 11.0.24, source/target 8 → 11 - Java 源码: import javax.servlet.* → import jakarta.servlet.*(约 330 处) - 字符串常量: "javax.servlet.context.tempdir/tmpdir" → jakarta 前缀(2 处) - web.xml: xmlns 从 java.sun.com → jakarta.ee,version → 5.0(2 个文件) 不修改 javax.sql / javax.imageio / javax.xml / javax.swing 等其它 Java SE 命名空间。 ## 兼容性 | 环境 | 版本 | 兼容性 | |------|------|--------| | Tomcat 10.0.x | Servlet 5.0 | ✓ | | Tomcat 10.1.x | Servlet 6.0 | ✓(向后兼容) | | Tomcat 11.0.x | Servlet 6.1 | ✓(向后兼容) | | JDK 11 ~ 21+ | | ✓ | ## 单元测试 - mvc 相关单元测试全部通过
|
gongqin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Member
|
CLA先签一下吧 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
javax.* 命名空间属于已停止维护的 Java EE 规范,Eclipse 基金会已于 2020 年将Java EE 迁移至 Jakarta EE,所有后续版本(Tomcat 10+)均采用 jakarta.* 命名空间。继续使用 javax.servlet 无法在主流应用服务器下运行,且存在安全漏洞无法修补的风险。
改动范围(最小化原则)
本次迁移严格遵循最小化改动原则,仅做命名空间替换,不涉及任何业务逻辑变更:
不修改 javax.sql / javax.imageio / javax.xml / javax.swing 等其它 Java SE 命名空间。
兼容性
单元测试