wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat Architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Architecture" Watch "Tomcat Architecture" New topic
Author

Tomcat Architecture

Mina Daoud
Ranch Hand

Joined: Sep 24, 2010
Posts: 88
Hi Guys,

I want to learn the Tomcat architecture, like why there is Temp folder and its usage (and all other folders). I googled a lot and read some books but all these resources hardly explain the architecture, it just explain how to configure and solve the common problems. Can anyone please refer me a link (if available) to explain the Tomcat structure and how it works?

Thanks,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

The Tomcat documentation at tomcat.apache.org is pretty good about this, as far as I'm concerned. Then again, I have been working with Tomcat for a very, very long time and one tends to forget what wasn't "obvious" to new users.

The work directory is used by Tomcat to hold files needed to do its work. For example, when a JSP is compiled into Java code and the Java code is then compiled into a class, the code and class files are stored in the work directory.

The temp directory is just a tomcat-specific directory for tempfiles. It's used to hold uploads, since when you do an HTTP upload, it doesn't actually upload a file, it uploads the data from a file (usually) and the incoming data is visible to the webapp as data, not as a file. But in the mean time, Tomcat wants someplace better than RAM to hold that data.

The temp directory is also the directory that will be used as the default base for java.io.File.mktemp() operations in webapps. Although the default location of the temp directory is under the Tomcat root, you can reassign it to an alternate location if you like - for example, "C:\temp\tomcat" or "/var/tomcat/temp".

The bin directory holds scripts and executables, the lib directory holds server common support libraries (JARs), logs go into the logs directory, configuration files go under "conf".

And if you haven't figured out what goes under webapps, you will soon.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mina Daoud
Ranch Hand

Joined: Sep 24, 2010
Posts: 88
Tim Holloway wrote:The Tomcat documentation at tomcat.apache.org is pretty good about this, as far as I'm concerned. Then again, I have been working with Tomcat for a very, very long time and one tends to forget what wasn't "obvious" to new users.

The work directory is used by Tomcat to hold files needed to do its work. For example, when a JSP is compiled into Java code and the Java code is then compiled into a class, the code and class files are stored in the work directory.

The temp directory is just a tomcat-specific directory for tempfiles. It's used to hold uploads, since when you do an HTTP upload, it doesn't actually upload a file, it uploads the data from a file (usually) and the incoming data is visible to the webapp as data, not as a file. But in the mean time, Tomcat wants someplace better than RAM to hold that data.

The temp directory is also the directory that will be used as the default base for java.io.File.mktemp() operations in webapps. Although the default location of the temp directory is under the Tomcat root, you can reassign it to an alternate location if you like - for example, "C:\temp\tomcat" or "/var/tomcat/temp".

The bin directory holds scripts and executables, the lib directory holds server common support libraries (JARs), logs go into the logs directory, configuration files go under "conf".

And if you haven't figured out what goes under webapps, you will soon.


Thanks Tim for the reply, it shed light on the folders usage. I actually work with Tomcat over 2 years now, but at a point after i knew how to solve my problems i face i wanted to learn how it works and why these folders exists. I think learning the structure of the tools i do use makes me do better coding and understand the root of any problems i face.
Thanks again for your help.
Laurent Tonon
Greenhorn

Joined: May 10, 2010
Posts: 3
Hi guys,

I've posted few month ago a diagram regarding the Tomcat architecture, you might be interested: http://marakana.com/forums/tomcat/general/106.html

I hope this would help

Cheers,
Laurent
Mina Daoud
Ranch Hand

Joined: Sep 24, 2010
Posts: 88
Laurent Tonon wrote:Hi guys,

I've posted few month ago a diagram regarding the Tomcat architecture, you might be interested: http://marakana.com/forums/tomcat/general/106.html

I hope this would help

Cheers,
Laurent


This is so nice diagram thanks so much for sharing
 
Consider Paul's rocket mass heater.
 
subject: Tomcat Architecture
 
Similar Threads
expain J2EE architecture
JSP can not find EJB.
Interview question: project structure ?
Running Two Tomcats
Architecture related