Fiona Applesmith

Greenhorn
+ Follow
since Sep 04, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fiona Applesmith

java file:


Note that the "pwd" process gives me the desired behavior.


jsp file:
14 years ago
I am trying to build an application where I hit a button from a jsp page, sending me to a servlet that uses runtime.exec to run a sql query on the server, then return the results to be displayed on the same page. Right now, i call proc.runtime.exec("get data"), then proc.waitFor(), then I forward(request, response) to the original page. Right now, this is working when i call runtime.exec on a very fast command, such as "pwd," but it is not working for my command which takes slightly longer to run - it redirects before the process has finished. Shouldn't waitFor() let the process terminate before forwarding the request? If not, are there alternatives I should be using?
14 years ago