Difference between javax.servlet-api.jar vs servlet-api.jar

后端 未结 5 493
囚心锁ツ
囚心锁ツ 2021-01-01 14:05

In my maven repository under groupId javax.servlet i have these two separate artifacts for servlets. I am confused which one should i use to build a simple serv

5条回答
  •  隐瞒了意图╮
    2021-01-01 14:32

    If you have to deploy on an ancient application server version that doesn't support the servlet 3.0 spec (hopefully unlikely), stick with the old servlet-api.

    With the 3.0 spec, they moved it over to javax.servlet-api. See: https://javaee.github.io/servlet-spec/

    Now, with the move of Java EE from Oracle to the Eclipse Foundation (Jakarta EE), the spec has again moved. If at all possible you may want to consider using the new group and artifact if you want to stay up-to-date: jakarta.servlet:jakarta.servlet-api

    https://github.com/eclipse-ee4j/servlet-api

提交回复
热议问题