tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: tomcat temp directory
Date Mon, 04 Jun 2007 11:53:15 GMT
In the code below, let's just ignore the logic for the string 'tempdir' 
... looks like noise to me as it isn't used in the creation of a file.

The call to create the temp file looks good and should store it in the 
path specified by  You can write out the system property 
to see where your files are going ... by default I think it's usually 
the system temp.  My install of tomcat 5.5 as a service explicitly set's 
it to the temp directory within the tomcat folder.  You can look for it 
in your .bat files by looking for

Could you expand on this image tag generation?  Looks like you are 
attempting to generate a temp image in a jsp and keep it long enough to 
return it via servlet.  Those are two separate requests (page and image) 
and it may already be gone by the time the client requests the image 
itself if that's the case.


Chris Pat wrote:

>I see in catalina.bat where it is setup and all the defaults are unchanged.  This still
does not explain why it is NOT putting the files in \temp and rather in just the root dir
of the TC installation.  I could explicitly force it, however that doesnt seem right.  
>Chris Pat <> wrote: Hi Martin, David
>Where/syntax to set the tmpdir?
>Below is the syntax I use and when run from local host it puts the files in the "root"
tomcat directory, at the same level as the all the subdirectories.  Even outside the webapp
directory.  However it is accessible.
>When I switch to accessing from a domain with modjk, TC cant find the file.  The very
same code that calls a servlet to populate a html img tag is blank, but the rest of the page
renders correctly.  
>I also found something claiming that TC configures its own tmp directory per webapp. 
Is that from the proper setting of CATALINA_TMPDIR in the server.xml?  with what syntax? 
>String tempdir = System.getProperty("");
>      if (! (tempdir.endsWith("/") || tempdir.endsWith("\\"))) {
>        tempdir = tempdir + System.getProperty("file.separator");
>      }
>      File tempFile = null;
>      try {
>        tempFile = File.createTempFile("myFile", "." + outputType);
>      }
>      catch (IOException ex2) {
>      }

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message