tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Costello" <>
Subject [Offtopic] Setting the directory where IO occurs in a servlet?
Date Sun, 30 Jun 2002 13:02:08 GMT
Hi Folks,

I have a servlet, running in Tomcat 4.0.3, which reads in files and
writes files.  Currently it does the reading and writing to the folder
where Tomcat was started.  I would like to have control over where the
servlet reads and writes.

My plan for controlling where IO occurs is to incorporate into my
webapps web.xml file the location of where I want IO to occur:


Then, in my servlet I will read in the path:

    physicalFilePath = getInitParameter("physicalFilePath");

At the point I would like to somehow express "from now on all IO done by
the servlet should go to the folder indicated by physicalFilePath".  Is
there some way to do that, either in the Java API or in the Servlet API?

Is this strategy that I am taking the best approach?  /Roger

P.S. I realize that this is not really the appropriate list for this
question.  What list do you recommend?

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

View raw message