tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: Share file between 2 apps
Date Wed, 02 Sep 2009 17:01:05 GMT
There are too many unknown constraints to answer - but I'll try.

In app B - use an init parameter which is a filename where test.xml is 

Then when app b needs to write the file;
File f = new File(servletContext.getInitParameter("myfile"));
FileWriter fw = new FileWriter(f);

If you need to read the file from app B, use a file reader. This is an 
easy way to keep the apps decoupled


ramzi khlil wrote:
> Hi All,
> I need to share a file between two applications, A and B.
> A: I put my web site under Root folder and it is using test.xml file.
> B: The second application which generate the xml file is host under webapps
> application.
> My question is how to allow to application B to update test.xml ?
> Regards

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

View raw message