61

Is Tomcat a web server or an application server?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Suresh S
  • 727
  • 1
  • 6
  • 3
  • 5
    @Suresh You may find better results on http://serverfault.com (Stack Overflow's Server-Question Website). – Sampson Mar 18 '10 at 13:05
  • 5
    this is not for server-fault, it is a theoretical development related question. – Nir Levy Mar 18 '10 at 13:10
  • Before posting any question. do add/show some research efforts. Additionally try to briefly explain your question. – IConfused Mar 12 '13 at 09:12
  • Coming from IBM: [Apache Tomcat](https://www.ibm.com/cloud/learn/web-server-vs-application-server) is an open source **application server** that executes Java Servlets, renders and delivers web pages that include JavaServer Page code, and serves Java Enterprise Edition (Java EE) applications. Released in 1998, Tomcat is the most widely used open source Java **application server**. – jumping_monkey May 13 '22 at 03:43

6 Answers6

62

Tomcat is a web server (can handle HTTP requests/responses) and web container (implements Java Servlet API, also called servletcontainer) in one. Some may call it an application server, but it is definitely not an fullfledged Java EE application server (it does not implement the whole Java EE API).

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
13

Tomcat is an application container that is also a web server. An application container can run web-applications (have "application" scope). It is not considered Some people do not consider it a full application server as it is lacking in some aspects such as user management and the like, but getting better all the time..

Nir Levy
  • 4,613
  • 2
  • 34
  • 47
  • @Nir it seems contradictory if tomcat can do 100% what web server does, then it should fall under a part application server – Suresh S Mar 18 '10 at 13:10
  • 7
    You cannot deploy EAR files to Tomcat. That makes it a non-application server. – Thorbjørn Ravn Andersen Mar 18 '10 at 13:10
  • @Andersen - but you can deply war. – Suresh S Mar 18 '10 at 13:10
  • @Andersen - can u deploy war file in apache http web server (which i think so?) – Suresh S Mar 18 '10 at 13:11
  • 1
    Who states that you need to be able to deploy an EAR for something to qualify as an "application server"? – matt b Mar 18 '10 at 13:13
  • @Suresh - if you mean httpd, then no you can't deploy WAR files to it. – JUST MY correct OPINION Mar 18 '10 at 13:16
  • A "web server" is something that can serve web pages (static & dynamic) and tomcat does that so it's a web server. An application server is something that runs applications and tomcat does that so it's also an application server. However, some would say it's not complete application server as it lacks some features that other application servers have, so the term "application container" is more suited imho. – Nir Levy Mar 18 '10 at 15:03
  • @Suresh also please understand that Tomcat server and Apache server are two different things. As Tomcat is part of the Apache Foundation it is something called "Apache Tomcat" which is confusing. http://en.wikipedia.org/wiki/Apache_Tomcat vs. http://en.wikipedia.org/wiki/Apache_HTTP_Server – Nir Levy Mar 18 '10 at 15:05
  • @ThorbjørnRavnAndersen if tomcat would be non-application server(web server) then it wouldn't handle servlet but it does . so i think it is 50% – Mahi Jan 25 '17 at 21:11
  • Tomcat does not implement the full profiles necessary for it to be called an Application Server under what is defines in the related JSRs, But so many people use it for serving applications that it is commonly refered to as an application server – Felipe Leão Jul 13 '18 at 20:22
10

Tomcat is a web server and a Servlet/JavaServer Pages container. It is often used as an application server for strictly web-based applications but does not include the entire suite of capabilities that a Java EE application server would supply.

Links:

JUST MY correct OPINION
  • 35,674
  • 17
  • 77
  • 99
6

Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies.

Since Tomcat does not implement the full Java EE specification for an application server, it can be considered as a web server.

Source: http://tomcat.apache.org

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
4

Application Server:

Application server maintains the application logic and
serves the web pages in response to user request.

That means application server can do both application logic maintanence and web page serving.

Web Server:

Web server just serves the web pages and it cannot enforce any application logic.

Final conclusion is: Application server also contains the web server.

For further Reference : http://www.javaworld.com/javaqa/2002-08/01-qa-0823-appvswebserver.html

i2ijeya
  • 15,952
  • 18
  • 63
  • 72
  • Additionally, Web server in Application server is called "reverse proxy" and it supports for load-balancing and responding static contents. – Orhun D. Mar 29 '16 at 13:02
0

It runs Java compiled code, it can maintain database connection pools, it can log errors of various types. I'd call it an application server, in fact I do. In our environment we have Apache as the webserver fronting a number of different application servers, including Tomcat and Coldfusion, and others.

Jay
  • 4,994
  • 4
  • 28
  • 41