1.
Web Module:
The Web Module is responsible for handling client requests and managing the user interface (UI)
of J2EE applications. It includes:
Servlets → Java programs that handle HTTP requests dynamically.
JSP (JavaServer Pages) → Allows embedding Java code into HTML pages.
WebSocket API → Supports real-time communication between client and server.
Web applications are packaged as WAR (Web Application Archive) files and deployed on a Web
Server or Application Server (e.g., Tomcat, WebLogic, JBoss).
2. EJB Module:
The EJB Module contains business logic components that process transactions and enforce
security. It includes:
Session Beans → Handle business logic (e.g., processing user transactions).
Message-Driven Beans (MDBs) → Process messages from a queue (JMS-based).
Entity Beans (Deprecated in Java EE) → Were used for database interaction but replaced
by JPA (Java Persistence API).
EJB components are packaged as JAR files and deployed on an Application Server like WebLogic
or JBoss.
3. Application Client Module:
The Application Client Module allows Java programs to interact with a J2EE application from a
standalone desktop client. It can:
Invoke remote EJB components using JNDI (Java Naming and Directory Interface).
Perform database queries using JDBC API.
Communicate with web services using SOAP (JAX-WS) or REST (JAX-RS).
Packaged as a JAR file and runs on a Java client machine.
4. Resource Adapter Module:
The Resource Adapter Module is used to connect J2EE applications with external enterprise
systems such as:
Legacy databases (e.g., IBM DB2, Oracle).
Enterprise Resource Planning (ERP) systems.
Mainframes and messaging systems.
It typically includes:
JCA Connector → Manages database connections.
Custom drivers → Implements protocols to connect Java EE apps with external resources.
Packaged as a RAR (Resource Adapter Archive) file and deployed inside the application server.