Catalog / Jakarta EE Cheat Sheet
Jakarta EE Cheat Sheet
A quick reference guide to Jakarta EE, covering essential APIs and components for building enterprise Java applications.
Core Concepts
Containers
Definition: A container provides a runtime environment for Jakarta EE components, managing their lifecycle, dependencies, and security. Types:
Responsibilities:
|
Components
Servlets: |
Java classes that handle HTTP requests and responses. Used for dynamic web content generation. |
JSPs (JavaServer Pages): |
Text-based documents that contain static content and dynamic Java code. Compiled into Servlets. |
EJBs (Enterprise JavaBeans): |
Server-side components that encapsulate business logic. Support transactions, security, and concurrency. |
CDI Beans (Contexts and Dependency Injection): |
Beans managed by the CDI container. Provide dependency injection and contextual lifecycle management. |
JAX-RS Resources: |
Java classes that expose RESTful web services. Annotated with |
Annotations
|
Web Tier
Servlets
Servlets handle client requests and generate responses. They are configured using annotations or deployment descriptors. Example:
|
Key methods: |
JavaServer Pages (JSPs)
JSPs allow embedding Java code within HTML. They are compiled into Servlets. Example:
|
Implicit Objects: |
Jakarta Faces
A component-based UI framework for building web applications. Uses Facelets (XML-based view technology). Key Components:
|
Example Facelets:
|
Business Tier
Enterprise JavaBeans (EJBs)
EJBs are server-side components for encapsulating business logic. They are managed by the EJB container. Types:
Example Session Bean:
|
Annotations: |
Contexts and Dependency Injection (CDI)
CDI provides dependency injection and contextual lifecycle management for Java EE applications. Key Concepts:
Example:
|
Transactions
Jakarta EE provides transaction management capabilities through JTA (Java Transaction API). Annotations:
Example:
|
Transaction Attributes: |
Data Tier & APIs
Jakarta Persistence (JPA)
JPA provides an API for managing relational data in Java applications. It supports object-relational mapping (ORM). Key Concepts:
Example Entity:
|
Annotations: |
Jakarta RESTful Web Services (JAX-RS)
JAX-RS is an API for building RESTful web services. Key Annotations:
Example:
|
Jakarta Messaging (JMS)
JMS provides an API for asynchronous messaging between applications. Key Concepts:
Example MDB:
|