There are a number of frequently asked questions that we get. These are many of them.
Jetty itself has no temporary directories, but you can assign a directory for each web application, 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:
webapp.getTempDirectory()
is set, use it. Do NOT delete it on jvm exit.</listitem>
<listitem>Iff javax.servlet.context.tempdir context attribute is set for this webapp && exists &&
writeable, then use it. Do NOT delete on jvm exit.</listitem>
</itemizedList>$(jetty.home)/work
exists create the directory there. Do NOT delete on jvm
exit. Do NOT delete contents if dir already exists.WEB-INF/work
exists create the directory there. Do NOT delete on jvm exit. Do
NOT delete contents if dir already exists.$(java.io.tmpdir)
. Set delete on jvm exit. Delete contents if dir
already exists.Be aware 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.