Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where should I place my txt file on Tomcat 3.2.2

 
Mike Dafel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Prabhat. It worked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic