File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Purpose of work directory in Tomcat

 
Rajpreet Bajwa
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rajpreet Bajwa
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic