Craig's solution to this is probably the easiest to implement. You could
also write a fairly trivial piece of JNI code that called the C getenv()
function. Downside to this is you're now platform-dependent (but you are
by using CGI already).
Wes
On Fri, 14 Apr 2000, Craig R. McClanahan wrote:
> Tom Eugelink wrote:
>
> > I tried using environment variables because the webserver that hosts my
> > website doesn't feature servlets yet. But I have not succeeded. It seems
> > that by deprecating the getenv() calls and suggesting property files, SUN
> > wants to prevent the usage of environment variables completely: either type
> > it in a property file or specify it as commandline parameters.
> >
> > As I said: I have not found a solution.
> >
>
> One time (long ago and far away ...) I had to write a Java app that was accessible
> via CGI, somewhat similar to what you're doing. What I ended up doing was writing
> a little C program that constructed a command line to execute my Java app,
> converting all environment variables it found into system property settings.
>
> So, for example, if you needed to pass CONTENT_LENGTH and CONTENT_TYPE, they got
> converted by my little C wrapper into a command line like:
>
> java -DCONTENT_LENGTH=xxx -DCONTENT_TYPE=yyy .... com.mycompany.MyApplication
>
> That way, my Java program could access these values with System.getProperty(). I'm
> sure someone savvy with shell scripts would be able to do this without a program,
> but for me C was easier.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets