> From: Chris Pat [mailto:[EMAIL PROTECTED]
> Subject: RE: tomcat temp directory
>
> Why however do I get null when I do the following?
> File tempDir = (File) sc.getAttribute("workDir");
> String tempDirStr = (String) sc.getAttribute("workDir"
String tempDirStr = (String) sc.getAttribute("workDir");
File tempFile = null;
"Caldarale, Charles R" <[EMAIL PROTECTED]> wrote: > From: Chris Pat
[mailto:[EMAIL PROTECTED]
> Subject: RE: tomcat temp directory
>
> How do I get the servletContext with
> From: Chris Pat [mailto:[EMAIL PROTECTED]
> Subject: RE: tomcat temp directory
>
> How do I get the servletContext within a method, within an
> Action.
Assuming your code is part of a servlet, use the
GenericServlet.getServletContext() method. If the servlet is hidden by
to:[EMAIL PROTECTED]
> Subject: RE: tomcat temp directory
>
> But how to I get at it programatically? Is workDir an actual
> context param that I can access and build a File from?
It's not a param, it's an attribute - read the servlet spec and the
servlet API doc. Use the ServletC
> From: Chris Pat [mailto:[EMAIL PROTECTED]
> Subject: RE: tomcat temp directory
>
> But how to I get at it programatically? Is workDir an actual
> context param that I can access and build a File from?
It's not a param, it's an attribute - read the servlet spec and
Hi Chuck
Thanks.
But how to I get at it programatically? Is workDir an actual context param
that I can access and build a File from?
"Caldarale, Charles R" <[EMAIL PROTECTED]> wrote: > From: Chris Pat
[mailto:[EMAIL PROTECTED]
> Subject: Re: tomcat temp directory
>
&
> From: Chris Pat [mailto:[EMAIL PROTECTED]
> Subject: Re: tomcat temp directory
>
> Or is there a better way to create a tmpdir and random file
> under the webapp.
Look at section 4.7.1 of the servlet spec:
"A temporary storage directory is required for each serv
temporary file is deleted on close");
out.close();
}
catch (IOException e) {
...
}
HTH,
Tim
> -Original Message-
> From: Chris Pat [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 04, 2007 6:38 AM
> To: Tomcat Users List
> Subject: Re: tomcat temp directory
>
H...
I'm not sure why hitting the 8080 HTTP connector would act differently
w/ respect to temp files than that 8009 AJP connector.
One thought that comes to mind is to have your own internal temp
directory. Since this won't be a real temp directory you will get the
advantage of a folder
Hi David
Thanks for further engaging this with me.
Yes, I am creating the file in an Action, dropping it in the tmpdir and reading
it with a jsp that calls a servlet that reads the parameters and displays.
What I find odd is everything works perfectly when executed from
localhost:8080... Ho
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 java.io.tmpdir. You can write out the system property
to see
Hi
Further
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 <[EMAIL
Hi Martin, David
Thanks.
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 acces
Hi Chris-
did you set CATALINA_TMPDIR to your TOMCAT temp folder?
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the
Tomcat doesn't have any config for the temp dir that I know of...it's
more of a jvm thing.
I believe Sun's jvm is supposed to delete the file when it's associated
file handle is gc'd. Can you provide your OS, jdk and a chunk of sample
code if how you are using the temp dir? Also assuming the
15 matches
Mail list logo