It's not a secret anymore!
The moose likes Beginning Java and the fly likes A easy  question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A easy  question" Watch "A easy  question" New topic

A easy question

hugo egon

Joined: Sep 16, 2004
Posts: 9

I'm new at java and I have a very easy question:

What is Tomcat?

A answer would be nice.

Thank you.
Kathy Sierra
Cowgirl and Author

Joined: Oct 10, 2002
Posts: 1589
Hi there,
Tomcat is a free Java 2 Enterprise Edition (J2EE) "Web Container". A Web Container is a piece of server software that works with a regular web server (like Apache, which you might be familiar with--it's one of the most popular web servers) and allows the web application to have more than just static HTML pages. A Web Container lets you Servlets and JSPs, which let you use Java code to do part of the work when a client using a web browser makes a request.

There's a Web Container running behind javaranch, for example, to support some of the things on javaranch that need more dynamic processing, or that require saving something to the server.

Basically, a Web Container lets you create web site "helper apps" in Java, rather than writing more conventional "CGI" programs in something like Perl.

So, if you want to write Java code to help support your web site, you need a Web Container like Tomcat. Tomcat can also be used as a stand-alone web server, but it's not very powerful for that... so most people configure Tomcat to work with a more powerful web server like Apache. Then when a client request comes in from a browser, Apache gets the request and decides (based on the request URL) if Apache can simply serve up a page sitting on the server, or if it needs to send the request to a Java servlet for processing.

Anyway, when you think of Tomcat, think of "Servlets and JSPs" or "Java code running as part of the web server".

Maxim Katcharov
Ranch Hand

Joined: Sep 07, 2004
Posts: 113
I hope the answer is as easy as you thought it would be

I don't know how new you are to java, or if the following will help, but I'll try and draw it out in the mud for ya:

Tomcat is a special type of server for JavaServer Pages, and Servlets.

Servlets are a sort of java program that runs on a special type of server. Servlets take in what you send them (when you click on a link or button, you send some info to a server), and spit out what they decide is the right thing to spit out (well, a webpage, just like the one you're looking at).

JSPs get compiled into Servlets.
willem jacobus odendaal

Joined: Sep 13, 2004
Posts: 12
peace yall!

I don't know how new you are to java....

Tomcat listens on port 8080 -confiquration info
and it has a folder called web(or something similar) in it's directory and if you place a web-app(.WAR)-file in it, tomcat will deploy it when it's(tomcat) running.

To start tomcat execute the startup.bat(or something similar) int it's bin folder.

A WAR file is similar to .jar and .rar in the sense that it's a compressed file containing all the goodies your application needs to run. This can be created following a 'New->Webb-application wizard in JBuilder for example.

How to do all the configurations is a different story but I hope this sheds some light.


PS - Remember this was never meant to be easy, thinking like a user makes java (and related technologies) very frustrating.
hugo egon

Joined: Sep 16, 2004
Posts: 9
Thanks for help
hugo egon

Joined: Sep 16, 2004
Posts: 9
(that's more to my upper coment

Thank's now I know more about Tomcat!

But I've got a second question now:

Where can I learn more about Servlets and JSP in specific?
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I learned Servlets (and a whole lot more) by doing the assignments in the JavaRanch Cattle Drive.

Marty Hall offers a free download of his very good book, "Core Servlets and JavaServer Pages" at

For further Servlet or JSP inquiries, I recommend moseying on over to the Servlets forum and the JSP forum.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
hugo egon

Joined: Sep 16, 2004
Posts: 9
Thanks for your information!!!
I agree. Here's the link:
subject: A easy question
It's not a secret anymore!