• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to specify the place from file which is going tobe read  RSS feed

 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I do that? When I use an Eclipse, its simple. The root directory of project is the place where I store my files. But what, let say, in servlets? When I read from servlets a file, it have been read from "user.dir" property (example: C:/Documents and Settings/Slobodan/".
How can I specify that a file should be read from the certain directory -in the example of servlets, the file beside web.xml file (servlets configuration file).
So what should I've done to achieve such?
Thanks!
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext.getRealPath().
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Rob. I have completely forgotten of context well, the tiredness done its job
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!