Temporary Directories

Jetty itself has no temporary directories, but each web application can be assigned a directory into which the war is unpacked, JSPs compiled on-the-fly etc.

The algorithm for determining a webapp's temporary directory location is as follows:

  1. Try to use an explicit directory specifically for this webapp:
  2. Create a directory based on global settings. The new directory will be called "Jetty_"host""port""context""+virtualhost :

It is important to note that a temporary directory will have its contents deleted when the webapp is stopped unless either:

Once a tempory directory has been allocated, a File instance for it is set and retrievable as the javax.servlet.context.tempdir attribute of the web application.