On Sun, 18 Aug 2002, Eddie Ruvinsky wrote:

> Date: Sun, 18 Aug 2002 17:52:18 -0700 (PDT)
> From: Eddie Ruvinsky <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: Tomcat 4.0.4: Unnecessary $TOMCAT/temp/ directory?
>
> Thanks Glenn.  The following Java API link has a quick
> blurb about the java.io.tmpdir system property:
>
> 
>http://java.sun.com/j2se/1.3/docs/api/java/io/File.html#createTempFile(java.lang.String,
> java.lang.String, java.io.File)
>
> The JDK sets the default value for this property to be
> /tmp on Unix and c:\temp on Windows.  So, it does not
> seem necessary to override the default value of
> java.io.tmpdir when starting Tomcat.
>
> My follow-up question then is, why is this done?  Is
> it to be able to create a separate "namespace" for
> temp files generated by the Tomcat JVM process versus
> the other temp files on the file system?
>

The servlet spec requires that each web application receive a servlet
context attribute named "javax.servlet.context.tempdir" that is a
java.io.File object to a temporary storage directory.  It is therefore not
reasonable to use the value specified by the "java.io.tmpdir" system
property, because that is global to the entire JVM.

See section 3.7.1 of the Servlet 2.3 spec:

  http://java.sun.com/products/servlet/download.html

The $CATALINA_HOME/temp directory hierarchy is how Tomcat implements this
spec requirement.  And you should be glad -- otherwise the servlet
generated for your "index.jsp" page (which is put in the per-context
temporary directory under a name specified by the JSP apge compiler) would
be stomped on by the servlet for some other webapp's "index.jsp" page.

> Thanks in advance,
> Eddie
>

Craig


> --- Glenn Nielsen <[EMAIL PROTECTED]> wrote:
> > Do not remove this temp directory.  This is the
> > temporary
> > directory configured in the Tomcat startup with
> > -Djava.io.tmpdir.  This temp directory is used by
> > the JVM
> > for internal things like jar files, etc.
> >
> > Regards,
> >
> > Glenn
> >
> > Eddie Ruvinsky wrote:
> > > I don't believe this is the case.  According to
> > the
> > > source, if the "workDir" attribute of StandardHost
> > is
> > > null (default case), the temp dir will be
> > generated
> > > inside $CATALINA_BASE/work/.  Otherwise, it will
> > be
> > > generated in the StandardHost's "workDir."
> > >
> > > I believe that it's unused and doesn't belong in
> > the
> > > Tomcat distribution.  Can someone confirm?
> > >
> > > -Eddie
> > >
> > > --- Mona Wong-Barnum <[EMAIL PROTECTED]>
> > wrote:
> > >
> > >>Hi Eddie:
> > >>
> > >>
> > >>>When I unpacked the distribution of Tomcat 4.0.4,
> > >>
> > >>I
> > >>
> > >>>noticed an empty temp/ directory in the Tomcat
> > >>
> > >>root
> > >>
> > >>>directory.  I don't believe it gets used anywhere
> > >>
> > >>in
> > >>
> > >>>the code.  Should it be cleaned up?
> > >>
> > >>  No leave it.  It will be used a temp directory in
> > >>your servlet code
> > >>(javax.servlet.context.tempdir)
> > >>
> > >>Cheers,
> > >>
> > >>Mona
> > >>
> > >>
> > >
> > >
> >
> ==================================================================
> > >
> > >>Mona Wong-Barnum
> > >>National Center for Microscopy and Imaging
> > Research
> > >>University of California, San Diego
> > >>http://ncmir.ucsd.edu/
> > >>
> > >>"The truth shall set you free, but first it will
> > >>piss you off"
> > >>                          A Landmark instructor
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to