Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File created in bin instead of web-app

 
rakesh sugirtharaj
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic