tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Long <>
Subject Persistent Storage for Webapps
Date Mon, 12 Oct 2009 11:01:44 GMT

In my webapp I need persistent storage. I am building my webapp as a
.war file, and copying it into $CATALINE_HOME/webapps/

Tomcat extracts $CATALINA_HOME/webapps/app.war to

The war file contains an empty directory /WEB-INF/data . During
operations, data files are created under /WEB-INF/data/

Today I created a new release, new.war and upgraded like: cat
/tmp/new.war >$CATALINA_HOME/webapps/app.war

app.war was re-extracted, and all of my data under /WEB-INF/data/

Question: id /WEB-INF/ in the extracted directory the correct place for
persistent data storage? If not, where is?

My goal is to find a consistent way of creating persistent data relative
to the context. I dont want to have to configure context parameters with
data directory paths for each installation.

I saw some code referencing the temp directory obtained from
ServletContext.getAttribute("javax.servlet.context.tempdir"), but I also
saw that this data is only guaranteed to last while the app is running.
Where can I find documentation of this behavior? grepping the servlet
spec returns no matches for "tempdir".

I'd appreciate any pointers.


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

View raw message