且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

J2EE中的容器到底是什么?它有什么帮助?

更新时间:2023-12-03 15:47:52

J2EE/Java EE应用程序不是自包含的.为了执行,需要在容器中部署.换句话说,容器在JVM之上提供了一个执行环境.

J2EE/Java EE applications aren't self contained. In order to be executed, they need to be deployed in a container. In other words, the container provides an execution environment on top of the JVM.

此外,应用程序依赖于几个API,例如JPA,EJB,Servlet,JMS,JNDI等.EE兼容容器的作用是为所有或某些API提供标准实现.这意味着从理论上讲,只要依赖标准API,您就可以在任何容器的顶部运行应用程序.

Also, applications rely on several APIs like JPA, EJB, servlet, JMS, JNDI, etc. The role of the EE compliant container is to provide a standard implementation of all or some of these APIs. This means you can theoretically run your application on top of any container as long as it relies on standard APIs.

从技术角度来看,容器只是具有main()方法的另一个Java SE应用程序.另一方面,EE应用程序是service/beans/servlets/etc的集合.容器找到这些组件并运行它们,从而提供API实现,监视,可伸缩性,可靠性等.

From a technical perspective, a container is just another Java SE application with a main() method. EE applications on the other hand are a collection of services/beans/servlets/etc. The container finds these components and runs them, providing API implementations, monitoring, scalability, reliability and so on.