File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes relative path problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "relative path problem" Watch "relative path problem" New topic
Author

relative path problem

Joshua Cloch
Ranch Hand

Joined: Apr 27, 2006
Posts: 95
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!


truehh@hotmail.com
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

ServletContext.getRealPath();


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joshua Cloch
Ranch Hand

Joined: Apr 27, 2006
Posts: 95
Thanks very much.The problem is solved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: relative path problem