Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

If a servlet opens a file...

 
Pep Menval
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...with no absolute path, I wonder where the hell this file is suposed to be. I've tried many places already: appliroot, WEB-INF, classes, classes/package... And yet, nothing at all.
Any idea about this issue?
Regards
Pep
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you run under Tomcat, may be it would be useful to check the bin directory
A better way to do this would be to use the getServletContext.getResource("/folder/file.txt") (web application document root relative path) and you will find file.txt without difficulty under <webappdirectory>\folder directory.
Regards,
Cyril.
[ November 16, 2003: Message edited by: cyril vidal ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic