On 22/04/2019 14:37, Christopher Schultz wrote:
> Garret,
> 
> On 4/22/19 09:36, Christopher Schultz wrote:
>> Mark,
> 
>> On 4/22/19 06:58, Mark Thomas wrote:
>>> On 21/04/2019 15:53, Garret Wilson wrote:
>>>> As I mentioned in other emails, I am embedding Tomcat 9 (with 
>>>> OpenJDK 11 on Windows 10) to serve static files from
>>>> `/foo/bar`. Currently I'm not supporting Java webapps. I'm not
>>>> supporting JSP. I just want to serve static files.
>>>>
>>>> From your help in another thread, I called the magic 
>>>> "gets-but-really-creates-a-connection" method and got it 
>>>> working.
>>>>
>>>> But now I realize Tomcat is creating this directory structur 
>>>> inside the "base dir" I specified:
>>>>
>>>> tomcat.8080/work/Tomcat/localhost/ROOT
>>>>
>>>> I don't need this directory. I don't want this directory
>>>> created. How do I tell Tomcat not to create no danged
>>>> directories?
> 
>>> The Servlet specification requires (see section 4.8.1 of the 
>>> Servlet 4.0 spec) that Tomcat provides a private temporary 
>>> directory for each servlet context (web application).
> 
>>> The best you can do is specify an absolute path that already
>>> exists for the Context's work directory. It doesn't need to be
>>> writeable. If you are using it for multiple web applications you
>>> probably don't want it to be writeable.
> 
>> Could a <Resource> be used to map a virtual directory for the work 
>> directory? For example, trick Tomcat into using a "directory"
>> within a JAR file or something as the "work" directory? Obviously,
>> it will fail if Tomcat tries to write a temporary file, but that's
>> kind of the point.

No. Tomcat doesn't use the web app resources infrastructure to find the
work directory.

>> George, you can always use the "document-root" (to use httpd's 
>> parlance) as the work directory, since it also must exist.
> 
> ^^^^ I meant Garret. Sorry, I had just read a message posted by George
> Stanchev and his name was on my mind.

I wouldn't recommend that in the general case. I'd worry about conflicts
and/or stuff getting deleted by accident.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to