This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60738
    
  65

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
 
Similar Threads
Having problem in logfile
log4j multiplelocation logging
Motif L&F : setting color to match the one set by Color Style Manager
Need a Maven/m2eclipse mentor, PLEASE!
Taking input from keyboard: takes ints, but not string