This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

relative path problem

 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys!

Here is the problem:

If I want to call an exe file when I donot use servlet,for example:

String[] info = {"c:\\ExecutableFileName.exe","c:\\filename.txt"};
Runtime.getRuntime().exec(info);

The code shown above works well.
Now I wanna move this to Tomcat using servlet.Suppose I put these two file in
webapps\test , How can I fine these two files?Any sample code is welcomed!

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext.getRealPath();
 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much.The problem is solved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic