wood burning stoves 2.0*
The moose likes Servlets and the fly likes File created in bin instead of web-app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File created in bin instead of web-app" Watch "File created in bin instead of web-app" New topic
Author

File created in bin instead of web-app

rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
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


Cheers!
RSR
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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
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.


Thanks and Regards
 
 
subject: File created in bin instead of web-app
 
Similar Threads
Uploading a JSP into a WAR file
Eclipse web.xml servlet mapping?
Jar files
JSP and Files
Creating a text file from a web application