3

I am new to java web technology. It is said that java web applications have two containers:

  • Web container
  • EE container

What are these containers? And how do they collaborate?

Some say that Tomcat is a web container, whereas in some places it is said that Tomcat is an application server.What is Tomcat exactly?

If I say web container + EE container = Application server is it correct?

zakinster
  • 10,508
  • 1
  • 41
  • 52
DesirePRG
  • 6,122
  • 15
  • 69
  • 114
  • your question is partially answered in http://stackoverflow.com/questions/17181292/java-ee-containers-vs-web-containers – upog Oct 15 '13 at 09:40

3 Answers3

6

Tomcat is just a Servlet container and also serves as a Web Server, that means it supports out-of-the-box Servlet API, JSF, Play framework, Spring (some set of features) and many others. On the other hand, Application Server is usually a superset of Servlet container which means that it contains all features that container has + all other Java EE capabilities like messaging, EJB, JTA, JavaMail, remoting and others.

So choice is mostly up to your requirements, however in the world of CDI, Servlet container should be sufficient for most applications (there is also transaction support from Java EE 7).

Some Servlet Containers

  • Apache Tomcat
  • Jetty

Some app servers

  • JBoss AS (now Wildfly)
  • Oracle WebLogic
  • Glassfish
Petr Mensik
  • 26,874
  • 17
  • 90
  • 115
4

Tomcat is a Servlet container. It's not a full fledged Java EE compliant Application Server, so it doesn't support for example EJBs or JMS out of the box.

Kayaman
  • 72,141
  • 5
  • 83
  • 121
1

I Think I myself found a reasonable answer for this via Wikepedia since nobody gave me a clear answer

Java Platform, Enterprise Edition or Java EE (was J2EE) defines the core set of API and features of Java Application Servers. The Web modules include servlets, and JavaServer Pages. Enterprise JavaBeans are used to manage transactions. According to the J2EE blueprints the business logic of an application resides in Enterprise JavaBeans - a modular server component providing many features, including declarative transaction management, and improving application scalability. Some Java Application Servers leave off many Java EE features like EJB and JMS including Tomcat from Apache, and Jetty from Eclipse Foundation. Their focus is more on Java Servlets and JavaServer Pages.

DesirePRG
  • 6,122
  • 15
  • 69
  • 114