From tomcat-user-return-89621-apmail-jakarta-tomcat-user-archive=jakarta.apache.org@jakarta.apache.org Fri Jan 16 19:21:26 2004 Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 39503 invoked from network); 16 Jan 2004 19:21:26 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 16 Jan 2004 19:21:26 -0000 Received: (qmail 41045 invoked by uid 500); 16 Jan 2004 19:20:56 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 41030 invoked by uid 500); 16 Jan 2004 19:20:56 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 41017 invoked from network); 16 Jan 2004 19:20:56 -0000 Received: from unknown (HELO sunburn.ccs.yorku.ca) (130.63.236.110) by daedalus.apache.org with SMTP; 16 Jan 2004 19:20:56 -0000 Received: from localhost (dantest@localhost) by sunburn.ccs.yorku.ca (8.12.10/8.12.8) with ESMTP id i0GJL083014221 for ; Fri, 16 Jan 2004 14:21:00 -0500 (EST) X-Authentication-Warning: sunburn.ccs.yorku.ca: dantest owned process doing -bs Date: Fri, 16 Jan 2004 14:21:00 -0500 (EST) From: Daniel X-X-Sender: dantest@sunburn.ccs.yorku.ca To: Tomcat Users List Subject: Re: proper way to access local dir? In-Reply-To: <40082FE5.8@joedog.org> Message-ID: References: <40082FE5.8@joedog.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thanks Jim. I like your JNDI method - hate having to muck with settings each time I deploy on different boxes. :) Regards, Daniel On Fri, 16 Jan 2004, Tim Funk wrote: > If you don't care about where the files are written to, you can use > "javax.servlet.context.tempdir". See the spec "SRV.3.7.1 Temporary Working > Directories" for details. > > If you need a permanent local directory, I prefer to use a JNDI string lookup > (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html) > to the name of the directory. This way I don't need to change my web.xml on > my development box vs qna vs production. > > > > -Tim > > Daniel wrote: > > > Hi, > > > > I'm trying to access a "file respository" (for read and write of files) > > from my servlet. I was wondering what's the best way to do this in a > > container/platform-independent manner? > > > > Is it possible without putting an "init" param in the web.xml that > > specifies my repository's directory or hard coding it into my servlet? > > > > I noticed the servlet 2.3 api has ServletContext.getResource(path) but > > it doesn't return a path to a local file directory that I'm interested > > in. :( > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org