tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Wanted: directory for persistent file storage for webapp
Date Wed, 24 May 2000 15:31:21 GMT
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?


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

View raw message