> 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
ssage without making a copy. Thank you.
- Original Message -
From: "Chris Pat"
To: "Tomcat"
Sent: Sunday, June 03, 2007 10:02 PM
Subject: tomcat temp directory
> Hello
> How do I configure and access a temporary directory in Tomcat5x? Oddly I
> am pres
ssage without making a copy. Thank you.
- Original Message -
From: "Chris Pat"
To: "Tomcat"
Sent: Sunday, June 03, 2007 10:02 PM
Subject: tomcat temp directory
> Hello
> How do I configure and access a temporary directory in Tomcat5x? Oddly I
> am pres
sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
- Original Message -
From: "Chris Pat" <[EMAIL PROTECTED]>
To: "Tomcat"
Sent: Sunday, June 03, 2007 10:02 PM
Subject: tomcat temp directory
Hello
How
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
Hello
How do I configure and access a temporary directory in Tomcat5x? Oddly I am
presently writing files I want to use immediately into java.io.tempdir and it
works if I access the webapp from localhost. However fails when accessed from
a domain.
Within the Action/servlet how to I write/re
16 matches
Mail list logo