In a running servlet I would like to read and write to a file in the location where the servlet is running. I have not been able to find a method that gives me that location. I have tried the following functions and they are not giving me the information I need. Could someone help me on what I am missing.
When I created a file and placed some text in the file I found the file in the Tom Cat directory. I don't want the file there. I would like to control the location of where the file is placed. My thoughts are if I know where the servlet is running then I can decide where to place the file as an offset of the location where the servlet class file is. I hope that makes sense.
It is not at all a good idea to create the files in webserver in which servlet runs instead u should decide the location where these files can be created on the server where this application is hosted in that way u have more control over the files
Satish SN<br />SCJP 1.4 & SCWCD 1.4
Joined: Apr 12, 2006
Thank you all. I have had a lot of fun. I have to rethink this all. WR