tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bailey" <>
Subject How to write files when web-app is a WAR?
Date Fri, 07 Jun 2002 19:02:20 GMT
>From what I've read, it seems that if you package your web application in a
WAR file, you have no way of attaining a path on the server's file system
that you can use to write files.  Reference:

I have a web app that we'd like to package as a WAR.  But, we need to be
able to write various data files out to the server's file system.  What
solution(s) are people using for this?  Writing the files to a database is
not acceptable for us  (I'm not a DBMS expert, but have been told that BLOB
performance is not great, and that using a DB as a file system replacement
is not good, etc.).

I was thinking we'd have to do a bit of a hack...  Basically, at the time we
"install" our application, the user will pick the real path on their disk
where the data files are stored.  We then store this in a property in
web.xml, and retrieve that in the app for using as the path.  For
links/hrefs on a web page, we'd just use something like /data_files, but
then set up a path-mapping that had /data_files mapped to say
/home/appname/data_files or whatever.   I also am assuming I will need to
ensure that this real path lies outside of the WAR expanded directory
because someday Tomcat (and maybe others already?) will not expand the WAR

Anyway, what have folks come up with?  While we use Tomcat for all our
development work, we'll likely have to support a variety of Servlet
containers (I think we can require at least Servlet 2.2, hopefully 2.3).

Chris Bailey
Code Intensity

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message