Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Running shell script through JSP

843840Jan 23 2009 — edited Jan 27 2009
Hi
I have shell script on my linux server .I want to create a jsp which calls the shell script .Currently i am writing JSP as
string cmd ="sh <path tp shell script>";
Runtime rt =Runtime.getRuntime();
Process p=rt.exec(cmd);
InputStream is = p.getInputStream();
p.waitFor();

I think there is nothing wrong with the concept .The script contains commands which contact the remote server like server on amazon .For running the instance of remote server command is issued and the server will give back the instance id (which takes time of 5 sec ).Based on the instance id given by remote server ,the following commands in script are executed .Now i have a confusion ,is it that commands use remote server connection did not allow the commands to execute properly or there is something wrong in my JSP code ??????

In either cases how do i make my jsp code run???

Plz reply as soon as possible
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2009
Added on Jan 23 2009
7 comments
602 views