HttpServer is meant for receiving the user request and identifying the resource to be processed and sending the response to the client. Whereas servlet container would be responsible for compiling the servlet using the javac and then executing the class file. The output of the servlet excution would be routed to the HttpServer which would send it as a response to the client. Hope this helps.
"Web Server" is not a hugely helpful name. Web pages are served using HTTP, so a Web Server is analagous to an Http Server. Its less confusing if you call "Apache" (often refered to as a web server) by its full name: Apache Http Server. [ January 25, 2005: Message edited by: Paul Sturrock ]
Note that Tomcat's "default" servlet acts as a plain HTTP server which is why a typical Tomcat installation serves plain web pages and resources such as image files as well as directing selected requests to servlets and servlets created from JSP. Unfortunately there is room for confusion because the Apache Software Foundation is the home of both the Apache web server and the Tomcat servlet engine/web server. Bill
Joined: Nov 19, 2000
Below is the answer I got from another forum. Please comment:
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.
Tomcat is the official reference implementation of the Java Servlet and JavaServer Pages technologies. Developed under the Apache license in an open and participatory environment. Apache has set of projects in which HTTP (web) Server and jakarta are two names of the projects. jakarta deals with java-related efforts. Under jakarta, we have Tomcat,Struts,Ant,Log4J and other ....
Tomcat's purpose is to provide standards-compliant support for servlets and JSP pages. The purpose of servlets and JSP pages is to generate web content such as HTML files or GIF files on demand using changing data. Web content that is generated on demand is said to be dynamic. On the other hand, web content that never changes and is served up as-is is called static.
While Tomcat is capable of serving both dynamic and static content, it is not as fast or feature-rich as the Apache web server with regard to static content. While it would be possible for Tomcat to be extended to support the same features that Apache does for serving up static content, it would take a great deal of time;
Apache has been under development for many years. Also, because Apache is written entirely in C and takes advantage of platform-specific features, it is unlikely that Tomcat, a 100% Java application, could ever perform well as Apache.
The earliest versions of Tomcat included a connector that enabled Tomcat and Apache to work together. In this arrangement, Apache receives all of the HTTP requests made to the web application. Apache then recognizes which requests are intended for servlets/JSP pages, and passes these requests to Tomcat.Tomcat fulfils the request and passes the response back to Apache, which then returns the response to the requestor.
However, as mentioned above, Apache will most likely always have superior performance and options when it comes to serving up static content and communicating with clients via HTTP, and, for this reason, anyone who is using Tomcat for hightraffic web applications may want to consider using Apache and Tomcat together.
Hareesh Ram Chanchali
SCJP 5.0, IBM Certified Solution Designer