Hello All,

Is there any way I can execute Runtime.exec() method from Servlet?

I tried to insert the following code inside the doPost() method of my
servlet, both directly or using another class but I keep getting the
Exception error.

////////
      Runtime r = Runtime.getRuntime();
      Process p = null;
        try {
          p = r.exec(ExecutablesProgram);
        } catch (Exception e) {
          System.out.println("Error Executing");
        }
///////
Then, when I try to insert the code outside the doPost() method, the code
was not executed at all...

I am a novice in Servlet (and Java...), so I don't now whether Servlet is
allowed to invoked a system call or not. If not, how can I invoke a system
call from Web browser? (Like Perl CGI's system() function )

Thanks in advance.

Regards,
Hiroshi






Runtime.getRuntime().exec(unix_command);

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to