tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From troylparr...@aol.com
Subject Re: Calling a CGI script from Servlet
Date Sun, 01 Aug 2010 14:12:26 GMT
Right you are, this is a system call, sorry for the mislabeling.  I will do that.  Thanks for
the pointer.
 

 


 

 

-----Original Message-----
From: Mark Thomas <markt@apache.org>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Sun, Aug 1, 2010 10:07 am
Subject: Re: Calling a CGI script from Servlet


On 01/08/2010 13:19, troylparrish@aol.com wrote:

> 

> 

> 

> Mark,

> 

> Thanks for the reply. I am using Tomcat 6.0.20.  The script is located in 

WEB-INF/cgi and in the call I am using an absolute path:

> 

> //System Call

> String[cmd] = {"python", 'home/troy/NetBeansProjects/GSMFilter/web/WEB-INF/cgi/helloWorld.py",


"-c"};

> Runtime rt = Runtime.getRuntime();

> Process proc = rt.exec(cmd);

> int exitVal = proc.waitFor();

> 

> //Write exit value to file - Get value of zero

> toFile.write("" + exitVal);



This is nothing to do with Tomcat's CGI servlet - you aren't using it.

However, you might want to look at the source code for Tomcat's CGI

Servlet - it might give you some pointers as to why your code isn't working.



Mark







---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org

For additional commands, e-mail: users-help@tomcat.apache.org




 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message