Before jumping into Java EE, let us first understand Java SE and Java ME.
Java SE (formerly J2SE)
stands for Java standard edition. It is also known as Core Java.It is used for developing standalone java programs or Applets. We just need a JVM(Java Virtual Machine) to execute an application developed in Java SE.
Java SE defines a range of general-purpose APIs and also includes the Java Language Specification and the Java Virtual Machine Specification.
One of the most well-known implementations of Java SE is Oracle’s Java Development Kit (JDK). OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE).
Java ME (formerly J2ME)
stands for Java micro edition. Java ME technology was created in order to deal with the constraints associated with building applications for small devices. Java ME technology makes it possible to create Java applications running on small devices with limited memory, display and power capacity.
It provides a robust, flexible environment for applications running on mobile and embedded devices: mobile phones, set-top boxes, Blu-ray Disc players, digital media devices, M2M modules, printers and more.
Let’s now delve into what Java EE is all about.
Java EE (formerly J2EE)
stands for Java enterprise edition and is used for developing server applications such as websites and web applications.
Java EE was created for developing and deploying multi-tier, distributed, enterprise scale business applications. J2EE Applications enjoy certain inherent benefits such as portability, security, scalability, load-balancing, and reusability.
Java EE does not compete with Java SE, but is instead a superset of APIs that builds upon the foundation provided by Java SE and the standard Java Development Kit (JDK).
All Java EE applications run on a Java virtual machine that supports all of the APIs defined by Java SE.
The J2EE platform consists of a set of services,APIs, and protocols that provide the functionality for developing multitiered, Web-based applications.
Java EE core technologies
Java EE core technologies broadly fall into the following categories:
HTTP client technologies.
For dealing with HTTP-based clients, Java EE includes the Java API for WebSocket programming, an API for JSON Processing, the JSF and Servlet APIs and the JSP Standard Tag Library (JSTL).
Database and resource access technologies.
For interacting with external and back-end systems, Java EE includes JavaMail, a standard connector architecture, a Java Message Service (JMS) API and a Java Transaction API (JTA) for enforcing two-phase commits.
REST and web service technologies:
To help with the development and deployment of REST-, SOAP-, XML- and JSON-based web services, the Java APIs for RESTful Web Services (JAX-RS) and XML-based web services (JAX-WS) are included, along with APIs for XML messaging and XML registries (JAXR).
Java EE security and container management:
For implementing custom Java EE security and managing Java EE containers, software developers have access to the Java Authorization Contract for Containers and the Java Authentication Service Provider Interface for Containers.
Some of the important Java EE specifications are:
- Servlet – defines how to manage HTTP requests, in a synchronous or asynchronous way.
- JavaServer Pages (JSP) – create dynamically generated web pages.JSPs are translated into servlets at runtime, therefore JSP is a Servlet; each JSP servlet is cached and re-used until the original JSP is modified.JavaServer Pages can be used independently or as the view component of a server-side model–view–controller design.
- Java API for WebSocket – defines a set of APIs to service WebSocket connections
- JavaServer Faces (JSF) – a technology for constructing user interfaces
- Unified Expression Language (EL) – is a simple language originally designed to satisfy the specific needs of web application developers. It is used specifically in Java Server Faces to bind components to (backing) beans and in Contexts and Dependency Injection to name beans, but can be used throughout the entire platform.
Web service specifications
- Java API for RESTful Web Services (JAX-RS)– provides support in creating web services according to the Representational State Transfer (REST) architectural pattern
- Java API for XML-based web services (JAX-WS)– can be used to create SOAP web services.
- Java Architecture for XML Binding – allows mapping XML into Java objects
- Contexts and Dependency Injection(CDI) – is a specification to provide a dependency injection container, as in Spring
- Enterprise JavaBeans (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.
- Java Transaction API (JTA) – contains the interfaces and annotations to interact with the transaction support offered by Java EE.
- Java Persistence API (JPA) – are specifications about object-relational mapping between relation database tables and Java classes.
- Java Messaging Service (JMS) – provides a common way for Java programs to create, send, receive and read an enterprise messaging system’s messages.
- JDBC API – is the API for connectivity with relational database systems.The JDBC API is included in Java SE, but this specification includes additional requirements on JDBC device drivers.
- Java Naming and Directory Interface (JNDI) -is the standard API for naming and directory access.The JNDI API is included in Java SE, but this specification defines additional requirements.
- JavaMail – allows an application component to send email.
- The Java Authentication and Authorization Service (JAAS) –enables services to authenticate and enforce access controls upon users.
- Bean Validation – defines a metadata model and API for JavaBean validation.
- Java EE Connector Architecture(JCA) – is a Java-based tool for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI).
Java Platform API (Batch) – provides a programming model for batch applications and a runtime for scheduling and executing jobs.
Java EE applications are hosted on application servers. J2EE compliant application servers have implementations of the J2EE specifications. For instance, OpenJPA is the implementation of JPA in IBM WebSphere Application Server.
Some of the popular application servers are mentioned below.