>I want to run some java applications (not applets) on the server-side with
>apache. Is there a more efficient way to do this than do just write CGI
>programs in Java?
I hope so. Java sucks for running as CGI code because it
doesn't (or at least didn't when I first played with it)
handle interpreter lines like
So you end up having to put a damn wrapper around every
I made a modification to mod_cgi to allow OS/2 to run
arbitrary (awk/perl/sh/...) scripts instead of just REXX
scripts and binaries. There's already code in mod_cgi
to catch CGI programs with ".CMD" (REXX) extensions.
If you put such a trap in for some arbitrary Java
extension (".class"?), then you could much more easily
run Java code as CGI programs.
Of course...you'd still need an easy way to get the
environment variables. The first bit of Java code that
I wrote (and about the last) was an interface to some
simple 'C' code to get environment variables. I know;
it's bad style, but it worked well. (The Better
Solution would be to send the data from the Apache
module in execl().)
Quote:>I'm thinking of something along the lines of mod_perl --
>but for Java.
Yeah, this would be better. FastCGI might also have
some benefits. Depending on the usage, prestarting
could be quite beneficial.
Of course, if you're using something that much, you
should probably just compile it.