J2EE's structure This is a component-based J2EE structure that has a platform-independent, making the J2EE program is very simple, as the business logic is encapsulated into a reused component, and the J2EE server is in the form of a container for all component types. Service. Because you don't have to develop this service yourself, you can concentrate on solving your business problems. The container and service container settings customize the inner support of the J2EE server, including security, transaction management, Java Naming and Directory Interface Addressing, Remote Connection, etc. The following is the most important services:
The J2EE security (Security) model allows you to configure web components or Enterprise Beans, which only access system resources can be accessed. Each customer belongs to a special role, and each role only allows a specific method. You should declare roles and activation methods in the Arrangement description of Enterprise Beans. Due to this declarative approach, you don't have to write rules that strengthen security.
J2EE Transaction Management Model allows you to specify a relationship between all methods in a transaction, such a transaction is used as a single unit. When the client activates the method in an Enterprise Bean, the container is involved in one management Transaction. Due to container management transactions, you don't have to encode the boundaries of your transaction in Enterprise Beans. The code that requires controlling distributed transactions will be very complicated. You only need to declare the transaction attribute of Enterprise Bean in the arrangement description file without writing and debugging complex code. The container will read this file and handle this Enterprise Bean's transaction.
JNDI Address (JNDI Lookup) provides a unified interface to multiple names and directory services within the enterprise, so application components can access names and directory services.
The J2EE Remote Connection (Remote Client Connectivity) model manages low-level interaction between client and Enterprise Beans. When an Enterprise Bean is created, a client can call it, just like it and the client is located on the same virtual machine.
Life Cycle Management Model Management Enterprise Bean creation and removal, an Enterprise Bean will have several states in its survival cycle. The container creates Enterprise Beans and moves him in the available instance pool and the active state, and eventually removes it from the container. Even if you can call Enterprise Bean's Create and REMOVE methods, the container will also perform these tasks in the background.
Database Connection Pooling model is a valuable resource. Getting a database connection is a time consuming, and the number of connections is very limited. The container is alleviated by managing the connection pool. Enterprise Beans can quickly get connected from the pool. The connection is used for other beans in the bean release. Container Type J2EE Applications can be installed to the following containers:
EJB container manages the execution of enterprise-class beans in all J2EE applications. Enterprise bean and their containers run on the J2EE server.
Web container manages the execution of the JSP page and the Servlet component in all J2EE applications. Web components and their containers are running on the J2EE server.
Application Client Vault Manages Perform execution of application client components in J2EE applications. The application client and their containers are running on the J2EE server.
The Applet container is a combination of web browsers and Java plugins running on the client machine.. 5. J2EE's core API and component J2EE platform consists of a set of services, applications interface (APIs), and protocols, which provide functional support for developing web-based multi-layer applications, and 13 of J2EE Technical specifications are simple description (limited to space, only simple descriptions): 1. JDBC API provides a unified way for accessing different databases, like ODBC, JDBC development Some detail issues, in addition, JDCB access to the database has a platform-independent. 2. JNDI (Java Name and Directory Interface): JNDI API is used to perform names and directory services. It provides a consistent model to access and operate enterprise resources such as DNS and LDAP, local file systems, or objects in the application server. 3. EJB (Enterprise Javabean): J2EE technology Win one thing is one of the reasons why some of the body is EJB. They provide a framework to develop and implement distributed business logic, which significantly simplifies the development of enterprise applications with scalability and highly complex. The EJB specification defines how EJB components interact with their containers. The container is responsible for providing public services, such as directory services, transaction management, security, resource buffer pools, and fault tolerance. But here is worth noting that EJB is not the only way to implement J2EE. It is because of the openness of J2EE, so that some vendors can achieve the same purpose in a way and EJB. 4. RMI (Remote Method Invoke): As indicated by its name, the RMI protocol calls the method on the remote object. It uses a serialized manner to pass data on the client and server. RMI is a more underlying protocol used by EJB. 5. Java IDL / CORBA: With the support of Java IDL, developers can integrate Java and Corba. They can create Java objects and make it expanded in Corba ORB, or they can also create Java classes and customers who are expanded with other ORBs. The latter approach provides another way, through which Java can be used to integrate your new application and old system. 6. JSP (Java Server Pages): The JSP page is composed of HTML code and the Java code embedded in it. The server is processed after the page is requested by the client, and then returns the generated HTML page to the client's browser. 7. Java servlet: servlet is a small Java program that extends the functionality of the web server. As a server-side application, starting when the request is performed, which is similar to the CGI Perl script. Most of the functionality provided by servlet is similar to JSP, but the implementation is different. JSP is usually embedded in a small amount of Java code in most HTML code, while servlets are written by Java and generate HTML. 8. XML (Extensible Markup Language): XML is a language that can be used to define other tag language. It is used to share data in different business processes. The development of XML and Java are independent of each other, but it is the same objective as Java is platform independence. By combining Java and XML, you can get a perfect platform-independent solution. 9. JMS (Java Message Service): MS is an application interface (API) for communicating with a message-oriented middleware.