0 Replies Latest reply on Apr 2, 2004 4:09 AM by conalloughrey

    Creating files 'on the fly' and retaining them between serve

    conalloughrey Newbie

      We are running Jboss 3.0.6/Tomcat 4.1.24 and are deploying the app in an ear file. When the server and app are up and running we create pdf files which are then used by our users. Our problem has been that we cannot access the directory within the ear file that the pdf files must be written to. We have since realised that it is not possible to write to a directory within an ear file (because it doesn't exist) and that we need to write it to a temporary directory (as specified in Servlet 2.3 specificatiion Section 3.7.1). We are able to access the javax.servlet.context.tempDir value (on our installation: c:/jbosstomcat/tomcat-4.1.x/work/MainEngine/localhost/_) and use that to store the files but everytime we restart the server this directory is cleaned out.

      Our question is: what method can we employ to store these pdf files to ensure they remain after server restarts?

      Do we maintain our own reference to a directory on the filesystem (e.g. C:/temp/pdffiles/). This would see to be bad code.

      Or is there a property we can set to enforce non-deletion of the contents of the tempDir.

      Thanks in advance for any help,
      Conal