It's not a secret anymore!
The moose likes Tomcat and the fly likes TomCat: web server or application server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "TomCat: web server or application server" Watch "TomCat: web server or application server" New topic

TomCat: web server or application server

Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
Hi guys.
i've just installed apache 4.0...
what I wonder are:
1. is it a web server enabled with a servlet runner || (or) an application server? or what?
2. what is its advantage on using j2ee sdk provided by sun? it also obeys the j2ee specs. servlet jsp apis r available etc..

thanks in advance!!!
Alfonso Harding
Ranch Hand

Joined: Feb 09, 2002
Posts: 35
Tomcat is a servlet container. It receives the web requests and passes them to the Java web applications. Since JSP pages are turned into servlets behind the scenes and servlets are not stand-alone applications, they are loaded into memory by the container. So its safe to say that Tomcat is a "mini" application server. Hope this helps.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

The j2ee sdk (with the accompanying Reference Implementation of an 'Application Server') is not just a servlet, or 'web' container.

It is also an EJB container.

This is the major difference between a servlet runner and full-blown application servers.

Apache *Tomcat* is a servlet container that is fully spec. compliant, that also has, as a convenience, a built-in web server. (it can understand and respond to HTTP requests)

Apache Web Server is well... a web server.

The J2EE RI that you get with the sdk is an EJB container. This makes it an application server.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
How does Tomcat differ from commercial products such as WebLogic or WebSphere?
Are these all interchangeable for Servlet and JSP work?

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Ravi Veera
Ranch Hand

Joined: Jun 23, 2001
Posts: 127
How does Tomcat differ from commercial products such as WebLogic or WebSphere?
Are these all interchangeable for Servlet and JSP work?

WebSphere,Weblogic are containers for servlets,JSP's and EJB's.
Tomcat is simply a container for Servlets and JSP's.
The answer to your question is Yes. Any servlets/JSP's that you write should be usable in all three products.
In fact if you are not doing EJB's in your project you may be better of using just a servlet container like Tomcat , Jetty or JRun.
Anjanesh Lekshminarayanan
Ranch Hand

Joined: Oct 21, 2003
Posts: 46
So if I just download J2EE SDK from, will I be able to run JSP pages / Servlets etc in localhost ?

Anjanesh Lekshminarayanan
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
Could someone explain this (simple to most I'm sure) and/or correct me? The only purpose of Apache is to accept HTTP requests, ability to set up virtual paths/home directories/etc.., for navigation, etc..,? So is Apache only good for setting up plain web sites (being HTML, PDFs, etc..,) or can it do anything other than that? I guess TomCat can do all that Apache web server does or do you also need to grab Apache web server when trying to create a web site? I was hoping for a simplistic explanation to how Apache and TomCat work, interact, and general tasks each perform. My understanding is that a JSP container, such as TomCat, allows communication with JSPs and so forth without having to compile programs each time before use, direct explicit passing of parameters, etc..,. Appreciate any feedback.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
@Rob Pike:

Indeed, Tomcat handles servlets and JSPs, which Apache by itself can't do. To this end, Apache needs to be set up to "forward" such requests to Tomcat, and after processing receive the results and send them back to the user. If all Apache did was just handle static pages like HTML and images, then Tomcat can do that as well. But Apache is much more flexible - you can configure lots more settings right out of the box, and there are tons of plug-in modules that extend its capabilities, e.g. you can set it up so that it handles PHP requests as well, or a number of other server-side languages. I would also assume that it scales much better, although I haven't seen a performance comparison in a long time.
I agree. Here's the link:
subject: TomCat: web server or application server
It's not a secret anymore!