R
RobertMaas
Let's say I have written a "Hello World" java program: h.java
and I've compiled it to: h.class
It emits a HTTP header line, a blank line, then the "Hello World!" line.
Is there any way to directly run that as a CGI script, or do I have to
use a shell script that calls java indirectly?
For example, in PERL, I can make a CGI PERL script directly, like this:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world!\n";
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-perl.cgi now.)
and likewise I can make direct scripts in sh:
#! /bin/sh
echo 'Content-type: text/html'
echo
echo 'Hello World!'
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-sh.cgi now.)
But in CMUCL, I have to
make a sh script that indirectly invokes CMUCL, like this:
#! /bin/sh
/usr/local/bin/lisp -eval '(progn (format t "Content-type: text/html~%~%Hello World!~%") (quit))'
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-cmucl.cgi now.)
So if my Hello World program is written in java, can I do it directly
like this:
#! /usr/local/jdk1.2.2/bin/java
something... h.class ...something
or do I have to do it indirectly via sh script like this:
#! /bin/sh
/usr/local/jdk1.2.2/bin/java h
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-java.cgi now.)
and I've compiled it to: h.class
It emits a HTTP header line, a blank line, then the "Hello World!" line.
Is there any way to directly run that as a CGI script, or do I have to
use a shell script that calls java indirectly?
For example, in PERL, I can make a CGI PERL script directly, like this:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world!\n";
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-perl.cgi now.)
and likewise I can make direct scripts in sh:
#! /bin/sh
echo 'Content-type: text/html'
echo
echo 'Hello World!'
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-sh.cgi now.)
But in CMUCL, I have to
make a sh script that indirectly invokes CMUCL, like this:
#! /bin/sh
/usr/local/bin/lisp -eval '(progn (format t "Content-type: text/html~%~%Hello World!~%") (quit))'
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-cmucl.cgi now.)
So if my Hello World program is written in java, can I do it directly
like this:
#! /usr/local/jdk1.2.2/bin/java
something... h.class ...something
or do I have to do it indirectly via sh script like this:
#! /bin/sh
/usr/local/jdk1.2.2/bin/java h
(That's what I have in http://www.rawbw.com/~rem/cgi-bin/h-java.cgi now.)