Or maybe your could just pass the cgi to a shell of some sort, it would set
up the enviroment ( .cshrc etc ) for you. The shell should inherit its
initial environment from its parent, ie the java exec.

Oh yes, this causes 2 calls to exec|CreateProcess but if you really really
have to have CGI...



-----Original Message-----
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 7:23 PM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat usability as a WebServer?



        Its one of those things that is, and isn't, very easy.  In its most
simplistic form, running a CGI is as easy as calling exec.  Passing
parameters specificed by GET are set as enviornment parameters, which exec
supports passing.  Pasing POST data is as easy as connecting the CGI's input
stream to the servlet's input stream.  The HTML output is also just as
simple.

        The real difficulty comes in when the CGI expects to have all of the
regular machine's environment variables set (i.e. PATH, CLASSPATH,
LD_LIBRARY_PATH, USER, etc).  Setting them isn't the problem, getting them
is, as Java has no way to read these.  You could fetch them with a bit of
native code, or a shell script (exec something like echo on MS-DOS, read,
parse, and store the response).

        Randy

-----Original Message-----
From: Jan Labanowski [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 2:22 PM
To: '[EMAIL PROTECTED]'
Cc: Jan Labanowski
Subject: RE: Tomcat usability as a WebServer?


On Mon, 5 Mar 2001, Samson, Lyndon [IT] wrote:

> But but but... tomcat does serve static pages. It can be used as a stand
> alone web server, and with a simple servlet, it could run cgi progams.
> 


Where is this simple servlet? Please do not confuse people...
Supporting the CGI protocol according to specs is quite involved 
since Environment variables are concerned... If the servlet simple,
I would like to see it...

Jan
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to