J2ee

Jakarta EE

Jakarta EE

Set of specifications extending Java SE


Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE[1] with specifications for enterprise features such as distributed computing and web services.[2] Jakarta EE applications are run on reference runtimes, which can be microservices or application servers, which handle transactions, security, scalability, concurrency and management of the components they are deploying.

Quick Facts Player software, Programming language(s) ...

Jakarta EE is defined by its specification. The specification defines APIs (application programming interface) and their interactions. As with other Java Community Process specifications, providers must meet certain conformance requirements in order to declare their products as Jakarta EE compliant.

Examples of contexts in which Jakarta EE referencing runtimes are used are: e-commerce, accounting, banking information systems.

History

The platform was known as Java 2 Platform, Enterprise Edition or J2EE from version 1.2, until the name was changed to Java Platform, Enterprise Edition or Java EE in version 1.5.

Java EE was maintained by Oracle under the Java Community Process. On September 12, 2017, Oracle Corporation announced that it would submit Java EE to the Eclipse Foundation.[3] The Eclipse top-level project has been named Eclipse Enterprise for Java (EE4J).[4] The Eclipse Foundation could not agree with Oracle over the use of javax and Java trademarks.[5] Oracle owns the trademark for the name "Java" and the platform was renamed from Java EE to Jakarta EE.[6][7] The name refers to the largest city on the island of Java and also the capital of Indonesia, Jakarta.[8] The name should not be confused with the former Jakarta Project which fostered a number of current and former Java projects at the Apache Software Foundation.

More information Platform version, Release ...

Specifications

Jakarta EE includes several specifications that serve different purposes, like generating web pages, reading and writing from a database in a transactional way, managing distributed queues.

The Jakarta EE APIs include several technologies that extend the functionality of the base Java SE APIs, such as Jakarta Enterprise Beans, connectors, servlets, Jakarta Server Pages and several web service technologies.

Web specifications

  • Jakarta Servlet: defines how to manage HTTP requests, in a synchronous or asynchronous way. It is low level and other Jakarta EE specifications rely on it;
  • Jakarta WebSocket: API specification that defines a set of APIs to service WebSocket connections;
  • Jakarta Faces: a technology for constructing user interfaces out of components;
  • Jakarta Expression Language (EL) is a simple language originally designed to satisfy the specific needs of web application developers. It is used specifically in Jakarta Faces to bind components to (backing) beans and in Contexts and Dependency Injection to named beans, but can be used throughout the entire platform.

Web service specifications

Enterprise specifications

  • Jakarta Activation (JAF) specifies an architecture to extend component Beans by providing data typing and bindings of such types.
  • Jakarta Contexts and Dependency Injection (CDI) is a specification to provide a dependency injection container;
  • Jakarta Enterprise Beans (EJB) specification defines a set of lightweight APIs that an object container (the EJB container) will support in order to provide transactions (using JTA), remote procedure calls (using RMI or RMI-IIOP), concurrency control, dependency injection and access control for business objects. This package contains the Jakarta Enterprise Beans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the ejb container.
  • Jakarta Persistence (JPA) are specifications about object-relational mapping between relation database tables and Java classes.
  • Jakarta Transactions (JTA) contains the interfaces and annotations to interact with the transaction support offered by Jakarta EE. Even though this API abstracts from the really low-level details, the interfaces are also considered somewhat low-level and the average application developer in Jakarta EE is either assumed to be relying on transparent handling of transactions by the higher level EJB abstractions, or using the annotations provided by this API in combination with CDI managed beans.
  • Jakarta Messaging (JMS) provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

Other specifications

  • Validation: This package contains the annotations and interfaces for the declarative validation support offered by the Bean Validation API. Bean Validation provides a unified way to provide constraints on beans (e.g. JPA model classes) that can be enforced cross-layer. In Jakarta EE, JPA honors bean validation constraints in the persistence layer, while JSF does so in the view layer.
  • Jakarta Batch provides the means for batch processing in applications to run long running background tasks that possibly involve a large volume of data and which may need to be periodically executed.
  • Jakarta Connectors is a Java-based tool for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI). This is a low-level API aimed at vendors that the average application developer typically does not come in contact with.

Web profile

In an attempt to limit the footprint of web containers, both in physical and in conceptual terms, the web profile was created, a subset of the Jakarta EE specifications. The Jakarta EE web profile comprises the following:

More information Specification, Java EE 6 ...

Certified referencing runtimes

Although by definition all Jakarta EE implementations provide the same base level of technologies (namely, the Jakarta EE spec and the associated APIs), they can differ considerably with respect to extra features (like connectors, clustering, fault tolerance, high availability, security, etc.), installed size, memory footprint, startup time, etc.

Jakarta EE

More information Developer, Licensing ...

Java EE

More information Referencing runtime, Developer ...

Code sample

The code sample shown below demonstrates how various technologies in Java EE 7 are used together to build a web form for editing a user.

In Jakarta EE a (web) UI can be built using Jakarta Servlet, Jakarta Server Pages (JSP), or Jakarta Faces (JSF) with Facelets. The example below uses Faces and Facelets. Not explicitly shown is that the input components use the Jakarta EE Bean Validation API under the covers to validate constraints.

<doc xmlns="http://www.w3.org/1999/xdoc"
      xmlns:h="http://xmlns.jcp.org/jsf/doc" xmlns:f="http://xmlns.jcp.org/jsf/core">

    <f:metadata>
        <f:viewParam name="user_id" value="#{userEdit.user}" converter="#{userConvertor}" />
    </f:metadata>

    <h:body>

        <h:messages />

        <h:form>
            <h:panelGrid columns="2">
                <h:outputLabel for="firstName" value="First name" />
                <h:inputText id="firstName" value="#{userEdit.user.firstName}" label="First name" />

                <h:outputLabel for="lastName" value="Last name" />
                <h:inputText id="lastName" value="#{userEdit.user.lastName}" label="Last name" />

                <h:commandButton action="#{userEdit.saveUser}" value="Save" />
            </h:panelGrid>
        </h:form>

    </h:body>
</doc>

Example Backing Bean class

To assist the view, Jakarta EE uses a concept called a "Backing Bean". The example below uses Contexts and Dependency Injection (CDI) and Jakarta Enterprise Beans (EJB).

@Named
@ViewScoped
public class UserEdit {

    private User user;

    @Inject
    private UserDAO userDAO;

    public String saveUser() {
        userDAO.save(this.user);
        addFlashMessage("User " + this.user.getId() + " saved");

        return "users.xdoc?faces-redirect=true";
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }
}

Example Data Access Object class

To implement business logic, Jakarta Enterprise Beans (EJB) is the dedicated technology in Jakarta EE. For the actual persistence, JDBC or Jakarta Persistence (JPA) can be used. The example below uses EJB and JPA. Not explicitly shown is that JTA is used under the covers by EJB to control transactional behavior.

@Stateless
public class UserDAO {

    @PersistenceContext
    private EntityManager entityManager;

    public void save(User user) {
        entityManager.persist(user);
    }

    public void update(User user) {
        entityManager.merge(user);
    }

    public List<User> getAll() {
        return entityManager.createNamedQuery("User.getAll", User.class)
                            .getResultList();
    }

}

Example Entity class

For defining entity/model classes Jakarta EE provides the Jakarta Persistence (JPA), and for expressing constraints on those entities it provides the Bean Validation API. The example below uses both these technologies.

@Entity
public class User {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Integer id;

    @Size(min = 2, message="First name too short")
    private String firstName;

    @Size(min = 2, message="Last name too short")
    private String lastName;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

}

See also


References

  1. "Differences between Java EE and Java SE - Your First Cup: An Introduction to the Java EE Platform". Docs.oracle.com. 2012-04-01. Retrieved 2012-07-18.
  2. "Java EE Overview". Oracle Corporation. Retrieved February 26, 2017.
  3. John K. Waters (2017-09-12). "Java EE Is Moving to the Eclipse Foundation". ADTmag. Retrieved 2017-09-13.
  4. Beaton, Wayne. "EE4J FAQ | The Eclipse Foundation". www.eclipse.org.
  5. Chirgwin, Richard (March 4, 2018). "Java EE renamed 'Jakarta EE' after Big Red brand spat". Software. The Register. Retrieved 19 March 2018.
  6. Vaughan-Nichols, Steven J. (March 5, 2018). "Good-bye JEE, hello Jakarta EE". Linux and Open Source. ZDNet. Retrieved 2020-07-10.
  7. Mmayel, Shabnam; Obradovic, Tanja (2020-12-08). "Jakarta EE 9 Released!". News. Jakarta EE. Eclipse Foundation. Retrieved 2022-03-05.
  8. Mmayel, Shabnam; Obradovic, Tanja (2019-09-10). "Jakarta EE 8 Released!". News. Jakarta EE. Eclipse Foundation. Retrieved 2022-03-05.
  9. Krill, Paul (November 21, 2003). "J2EE 1.4 spec certified". Software Development. InfoWorld. Retrieved 2022-03-05.
  10. Copeland, Lee (September 24, 2001). "Sun unveils J2EE 1.3". Software Development. Computerworld. Retrieved 2022-03-05.
  11. "Web Profile Definition". Jakarta EE WebProfile. 8. Jakarta EE. Eclipse Foundation. Retrieved 2022-03-05.
  12. "Web Profile Definition". Jakarta EE WebProfile. 9. Jakarta EE. Eclipse Foundation. Retrieved 2022-03-05.
  13. "Web Profile Definition". Jakarta EE WebProfile. 9.1. Jakarta EE. Eclipse Foundation. Retrieved 2022-03-05.
  14. "Web Profile Definition". Jakarta EE WebProfile. 10. Jakarta EE. Eclipse Foundation. Retrieved 2022-09-27.
  15. "Apache TomEE". tomee.apache.org. Retrieved 2024-01-08.
  16. "Java EE Compatibility". www.oracle.com. Retrieved 2018-08-05.
  17. "Java EE Compatibility". Java.sun.com. 2010-09-07. Retrieved 2012-07-18.
  18. Lyons, Will; Humphrey, Pieter (2011). "Oracle Web Logic Server 12c: Developing Modern, Lightweight Java EE 6 Applications" (PDF). Archived from the original (PDF) on 2011-12-15. Retrieved 2011-12-03.
  19. "JBoss AS is now EE5 certified!". 15 September 2008. Archived from the original on 20 September 2008. Retrieved 7 August 2016.
  20. Business Wire (2012-06-20). "Red Hat Launches JBoss Enterprise Application Platform 6 to Help Enterprises Move Application Development and Deployment to the Cloud". Business Wire. Retrieved 2012-07-18. {{cite web}}: |author= has generic name (help)
  21. "Apache Geronimo : Index". geronimo.apache.org. January 25, 2010.
  22. "Apache Geronimo fully certified for Java EE 6 - The H Open: News and Features". H-online.com. 2011-11-14. Archived from the original on 20 April 2012. Retrieved 2012-07-18.
  23. "Tested Configurations, Java EE 6 - TMAX JEUS 7". Oracle.com. 2010-09-07. Retrieved 2012-07-18.
  24. "Java EE6 Web Application Server, WAS Software". Us.tmaxsoft.com. Archived from the original on 2012-07-02. Retrieved 2012-07-18.
  25. "Tested Configurations, Java EE6 - Fujitsu Interstage". Oracle.com. 2010-09-07. Retrieved 2012-07-18.
  26. "Apache TomEE". Openejb.apache.org. Retrieved 2012-07-18.
  27. "MarketWatch.com". MarketWatch.com. Retrieved 2012-07-18.
  28. TomEE, Apache. "Apache TomEE 7.0.1".
  29. "Resin Application Server Java EE 6 Web Profile" (PDF). caucho.com. 2011. Archived (PDF) from the original on 2022-10-09.
  30. "JOnAS 5.3.0 RC1 released". jonas.ow2.org. 2013-01-07. Archived from the original on 2013-10-15. Retrieved 2014-02-25.

Share this article:

This article uses material from the Wikipedia article J2ee, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.