This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Purpose of work directory in Tomcat 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 "Purpose of work directory in Tomcat" Watch "Purpose of work directory in Tomcat" New topic
Author

Purpose of work directory in Tomcat

Rajpreet Bajwa
Greenhorn

Joined: Feb 09, 2002
Posts: 14
I noticed that when I deploy a war file under webapps, Tomcat explodes the war file under the webapps folder. It also creates another folder under $TOMCAT_HOME/work/Catalina/localhost/mywarname/. I noticed this is where the servlet classes are kept.

However, another folder is created under $TOMCAT_HOME/work/Catalina/mywarname/ , this folder contains 2 files 1. SESSIONS.ser 2. tldCache.ser. What is stored in these files ? How/When are these refreshed ?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The work directory, as its name suggests, is where Tomcat writes any files that it needs during run time, such as the generated servlet code for JSPs, the class files for the same after they are compiled, the serialized sessions during restarts or shutdowns (SESSIONS.ser).
It is also where your application's tmpdir is located context scoped attribute with name "javax.servlet.context.tempdir".

Also, if you have Tomcat configured not to unapack war files when deployed, your web app's directory structure will be created under the work directory instead of the "webapps" directory.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Dear "rajpreet",

I am one of the moderators of the JavaRanch forums. Here on JavaRanch, we have a naming policy. We want the users of JavaRanch to use a real-sounding name as their display name.

Unfortunately, your name "rajpreet" does not comply to the naming policy. Your name should consist of a real-sounding first name, space, and second name. No obviously fake name and your second name should not consist of initials only.

Please read the naming policy carefully and change your display name. You can change your name by editing your profile.

Please note that we are taking the naming policy seriously. If you do not change your display name, your account on JavaRanch might be locked.

Note that if your name does not comply to the naming policy, you will not be eligible to win the book in the book giveaway currently running in this forum.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Rajpreet Bajwa
Greenhorn

Joined: Feb 09, 2002
Posts: 14
I have included my last name in the display name. I wasn't aware that last name was essential, and I am sure my first name is not fake
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Purpose of work directory in Tomcat
 
Similar Threads
i am a tomcat idiot. Need help using context roots
String class can't find split method: wrong java version?
cant deploy my application,please help
Eclispe's Dynamic Web Project
Advice on deploying WAR file