Java Enterprise Edition Architecture
JEE uses a 4-level model for web development as depicted in figure below. The browser runs on the client displaying HTML and optionally runs JavaScript. The middle tier is comprised of two layers: a Presentation Layer and a Business Logic Layer. The EIS tier manages persistent data in a database and, where appropriate, legacy data stores.
Figure 1: Java Enterprise Edition Architecture
JEE implements the Presentation Layer with Servlets and JavaServer Pages (JSP). Servlet and JSP generate web pages with dynamic content (typically originating from the database). They also parse web pages submitted from the client and pass them to Enterprise JavaBeans for handling. Servlets and JSPs run inside a Web Server.
JEE implements the Business Logic layer with Enterprise JavaBeans (EJBs). EJBs are responsible for logic like validation and calculations as well as provided data access (e.g. database I/O) for the application. Enterprise JavaBeans run inside an Application Sever.
Under JEE, EJBs access a database through one of two means:
using a JDBC interface which requires a lower level of coding and/or
using SQLJ which provides a higher level interface to the database
In addition to these components for web application, JEE provides for access by non-web clients to the business logic layer. A standalone Java application (IIOP client) can access an EJB directly using JEE’s Remote Method Invocation (RMI) API.