In my web app i am trying to create a new file temp. But this file gets created in tomcat/bin folder. Why is this happening and how can i create a file inside my web app?
when you start the servlet container, the bin directory becomes the 'current directory', so when you ask to create a file and don't specify a location, it gets cretaed in the 'current directory'. If you want something else, you will need to specify the directory.
Satya Maheshwari
Ranch Hand
Joined: Jan 01, 2007
Posts: 368
posted
0
Originally posted by rakesh sugirtharaj: Hi all,
In my web app i am trying to create a new file temp. But this file gets created in tomcat/bin folder. Why is this happening and how can i create a file inside my web app?
Thanks in advance
Could you paste the code to show what you are trying to do? You can use servletContext.getRealPath to know the real path of your application and determine the relative path to create the new file.