wood burning stoves 2.0
The moose likes Servlets and the fly likes Servlet container - what is the real definition? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet container - what is the real definition?" Watch "Servlet container - what is the real definition?" New topic

Servlet container - what is the real definition?

Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
The request is received by the Web server and handed off to the servlet con-
tainer. The servlet container can be running in the same process as the host
Web server, in a different process on the same host, or on a different host from
the Web server for which it processes requests.

The above text is from servlet specification. I can't understand the next issue: Is the servlet container and web-server the same thing? Is, for instance, Tomcat just a servlet container, or both of them? From the above definition i deduct that servlet container and web server are two different things. Why than to run a web application, we just install Tomcat, without any additional web server? Illuminate me, please!

If you think you've done too much, usually it means you've done too few.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 607

A web server is something that just does one Job and that is to serve static web pages. Web server takes care of getting a request to a web page and getting the web page back to the user.
Apache is a web server.

The servlet container is the process that takes care of executing the Servlet/Jsp code and turning them into web page that the web server can deliver back to the client.
Tomcat is a web container.

The only reason that you do not have to install a separate web server when you install Tomcat is because Tomcat installs the Apache web server and the Tomcat Container. (That's why its called Apache Tomcat I assume )

Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

The FAQ entry on the topic.

|Asking Good Questions|
I agree. Here's the link: http://aspose.com/file-tools
subject: Servlet container - what is the real definition?
It's not a secret anymore!