Thanks a lot for the replies. They are very helpful. I made some
progress.
I found that the external program can be launched within JSP only if it
is stateless. If the external program tries to open a window, the
process will be hanging on and never get finished. I know, in reality,
we won't use
See http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html.
In brief, you cannot execute a batch file this way. The article contains
examples and will solve your problem.
-- Jeanfrancois
Jack Li wrote:
Hi, How to execute a command line program in jsp or servlet?
In a test
try doing :
Runtime r = Runtime.getRuntime();
Process p = r.exec(ExecutionParam);
//and if you want to wait while the process executes you can use :
p.waitFor();
all of this inside a try/catch block should compile and work.
hope it helps
-reynir
-Original Message-
From:
Executing System.getProperty(user.dir) will tell you what directory you are working
out of.
-Dave
-Original Message-
From: Reynir Hübner [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 2:46 PM
To: Tomcat Users List
Subject: RE: How to execute a command line program