Home > front end >  Java Spring requires some EE features in Tomcat. Is Spring a Jakarta EE framework?
Java Spring requires some EE features in Tomcat. Is Spring a Jakarta EE framework?

Time:04-18

I spent the last few days trying to wrap my head around the Java ecosystem, looking at the components (JVM, JRE, JDK, SE, EE, etc.), licensing and others.

As far as I understand, Jakarta EE (formerly Java EE, J2EE) is an API on top of Java SE with lots of enterprise-grade features and lots of (mostly deprecated) web technologies. Spring has similar goals but a different approach and runs on "standard" Java SE.

But then what about Tomcat? Tomcat is defined as an implementation of Jakarta EE features. I understand that TomEE is a "superset" of Tomcat with more Jakarta EE features.

Nevertheless, Spring (needs / requires) Tomcat as a runtime. Does that mean that Spring uses Jakarta EE features? Could you please clarify these differences?

CodePudding user response:

Tomcat 10 offers JakartaEE, but no JEE. Versions lower than 10 implement JEE but no JakartaEE. Here's the overview

To my knowledge, spring works on JEE, but not JakartaEE (at the time of writing this answer). So if you want to use tomcat with spring, pick version 9 (as of today), or another JEE container.

CodePudding user response:

Spring does not implement most of the JakartaEE/JavaEE specification. One of the Spring project that implements a JSR defined in JavaEE that I can think of is spring-batch (see this).

Instead, Spring mainly provides support to integrate with a carefully selected individual specifications from JavaEE to allow developers to work with the implementation of these specifications using the Spring programming model (See this for more detail.)

Tomcat is the implementation of the Servlet API which is one of the specification that is included in JakartaEE/JavaEE. To me , the most useful and modern support provided by Spring for it is spring-boot allows to package the application using an embeddable Tomcat such that we can simply deploy and run the application as a JAR without install a Tomcat server separately and deploy the WAR to it.

  • Related