aspose file tools*
The moose likes Servlets and the fly likes where should I place my txt file on Tomcat 3.2.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "where should I place my txt file on Tomcat 3.2.2" Watch "where should I place my txt file on Tomcat 3.2.2" New topic
Author

where should I place my txt file on Tomcat 3.2.2

Mike Dafel
Greenhorn

Joined: Jul 12, 2001
Posts: 10
Hi,
This is an urgent problem. I have to read a txt file from my servlet, and I don't know where to put that file, I mean in which directory. Also, how should I reference that? I mean the relative path (e.g.: ../file.txt).
I am using tomcat 3.2.2
I have tried a lot, but no luck. Please this is urgent and ofcourse, thanks in advance.
prabhat kumar
Ranch Hand

Joined: Apr 11, 2001
Posts: 114
suppose u have placed ur application in
webapps/myapp
and /myapp directory structure is as follows

then u can refer to directory /myfiles form the /myservlets as:
"..\\webapps\\myapp\\myfiles\\abc.txt"
hope it will help
[ February 21, 2002: Message edited by: prabhat kumat ]
Mike Dafel
Greenhorn

Joined: Jul 12, 2001
Posts: 10
Thanks Prabhat. It worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where should I place my txt file on Tomcat 3.2.2