Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 69625 invoked from network); 24 May 2000 22:34:37 -0000 Received: from w153.z209031224.sjc-ca.dsl.cnc.net (HELO edamame.stinky.com) (qmailr@209.31.224.153) by locus.apache.org with SMTP; 24 May 2000 22:34:37 -0000 Received: (qmail 11878 invoked by uid 510); 24 May 2000 15:31:21 -0000 Date: Wed, 24 May 2000 08:31:21 -0700 From: guru@edamame.stinky.com To: tomcat-user@jakarta.apache.org Cc: guru@edamame.stinky.com Subject: Wanted: directory for persistent file storage for webapp Message-ID: <20000524083121.A11484@edamame.stinky.com> Reply-To: alex@jguru.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Let's say I have a guest log servlet. Users can come in and write messages; the messages get saved to a file; the servlet loads in the file and displays the content inside itself. Easy, right? But... WHERE DO I STORE THE FILE? Back before webapps, it was easy. I could use getRealPath() or some such and write the file in the servlet's directory, or in the web document directory, or in some hardcoded location. But with webapps, where you can deploy a WAR on an unknown server, there's no platform-independent way to discover a persistent work directory -- or is there? A related issue is, how to write *web* accessible content. That is, if I have a servlet that writes a GIF, where do I save it so that a web browser can access it? Especially if I want to save it so a URL with the context-string attached (/application/images/new.gif). Again, I know there are ways to hack this in on a per-server basis, probably using init parameters. But does the Servlets 2.2 spec address these issues at all? I've read it through and it doesn't seem to. - Alex http://www.jguru.com/alex/