John Doe
John Doe

Reputation: 536

Is Tomcat an HTTP server or a Servlet container?

When I downloaded Apache Tomcat it seem to be both an HTTP server and a Servlet container. Can I use Apache Tomcat with a different HTTP server than the one built-in in Tomcat ?

Upvotes: 3

Views: 4574

Answers (2)

Abhinav
Abhinav

Reputation: 540

Generally,a program that accepts incoming HTTP connections is called a web server. In that case Apache Tomcat is a web server as it supports HTTP protocol and it is also a web container as it supports Java server pages (JSP)/Servlet, Application programming interfaces(APIs) as well.

Tomcat doesn’t include the typical features of a web server,where the Apache manages the static data of the web pages,redirection etc whereas tomcat manages the web application.

N.B.:- This link will enlighten you about the basic concepts of web server, web container and application server!

Upvotes: 2

fairtrax
fairtrax

Reputation: 426

At tomcat webpage there is:

The Apache Tomcat® software is an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies

So yes, it is a servlet container as well. Generally, HTTP Server is just a server, that handles http requests (GET/POST/DELETE/PUT and some others rarely used). With pure http server, you couldn't run any servlet or jsp script.

I have no idea, how to replace the http server by a different one, but this documentation may be helpful for you - how it works together with appache http server.

https://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

Upvotes: 4

Related Questions