What is the difference between "A Web Server" and "A Servlet Container"?
In general are all Web Servers Servlet(Web) Containers too or vice versa?
I have been using Apache Tomcat for JSP and Apache for PHP but unable to figure out the exact difference between those two, where exactly lies the difference?
I tried searching previous threads but could not find much.
Thanks! :-)
A Servlet Container is a Web Server that must be able to run Java Servlets. Web Server, on the other hand, is a broader term including all software running and communicating through HTTP protocol. Under these definitions: All Servlet Containers are Web Servers.
Apache Tomcat server: Apache Tomcat is a web container. It allows the users to run Servlet and JAVA Server Pages that are based on the web-applications. It can be used as the HTTP server. The performance of the Tomcat server is not as good as the designated web server.
An HTTP server can handle only HTML files. A web container or servlet container can handle Servlets and JSPs. An application server contains a web container and EJB container and can handle Servlets, JSPs, and EJBs. EJBs can be deployed only on Application Servers, but not on web containers.
Although its flexible configuration and interoperability with supporting technologies have enabled Apache Tomcat to act as a web application server in many circumstances, Tomcat is primarily a Java servlet container.
A Servlet Container is a Web Server that must be able to run Java Servlets.
Web Server, on the other hand, is a broader term including all software running and communicating through HTTP protocol.
Under these definitions:
HTTP is the Hypertext Transport Protocol. Both Apache and Tomcat will accept HTTP requests.
The difference is that Apache is JUST an HTTP server. It serves up static HTML pages.
Tomcat has an HTTP listener inside it, but in addition to that it has a servlet/JSP engine. It can serve up both static and dynamic HTML pages.
You can use Tomcat without Apache.
Apache cannot handle servlet/JSP requests without having a servlet/JSP engine bolted on top of it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With