Java is creating file in tomcat bin folder

I have written a java program in which I am creating a file.

BufferedWriter writer =
    new BufferedWriter(
        new OutputStreamWriter(
            new FileOutputStream("myfile.txt"))

It is creating the file in the current folder (my project folder). Till here everything is perfect. Now I have designed a servlet and call this class. The file is now getting created in the tomcat bin folder. Do I need to make any changes to classpath or server.xml or context.xml in tomcat?


Download java.is.creating.file.in.tomcat.bin.folder.zip
Direct Link


Download


Download java.is.creating.file.in.tomcat.bin.folder.zip
Mediafire


Download


Download java.is.creating.file.in.tomcat.bin.folder.zip
Billionuploads


Download


Download java.is.creating.file.in.tomcat.bin.folder.zip
Unlimitzone


Download


Download java.is.creating.file.in.tomcat.bin.folder.zip
Hotfile


Download

Both comments and pings are currently closed.

Comments are closed.