• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat Architecture

 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic