suppongo che hai creato un Process con Runtime.getRuntime().exec(command) quindi puoi aspettare
try {
int r = process.waitFor();
System.out.println("Exit value: " + r);
} catch (InterruptedException iex) {}
la servlet aspetta fino a che il processo finisce :sexpulp: