Try Runtime object.
import java.io.*;
String cmmd;
Runtime rt = Runtime.getRuntime();
Process p = rt.exec( cmmd );
if( p.waitFor() != 0 ) {
System.out.println("E", "Error executing command Line: " + cmmd);
System.exit( -1 );
}
Thanks,
Ling Ma
510.574.5985
> X-Server: Advanced Direct Remailer (www.ml-design.com)
> X-Priority: 3 (Normal)
> Content-Transfer-Encoding: 7bit
> Date: Wed, 30 May 2001 02:36:20 +0200
> From: Porta Joseph <[EMAIL PROTECTED]>
> Subject: execute a shell file from within a JSP page
> To: [EMAIL PROTECTED]
>
> Hi friends,
>
> sorry if the question isn't new but is there a way of executing a
> shell script (or another executable) from within a JSP page (like exec
> or system in Perl), get the result back and include it in the result
> stream from the JSP page to the webbrowser.
>
> thankyou, Joseph Porta
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets