Tom,

I just found this.
http://forum2.java.sun.com/forum?14@@.ee7780f

The code given as the EnvVars class:
I have tried it and it works ... on WinNT anyway ... it seems to use cmd
somehow ... dont think it can be very efficient.

I am still going to write a method to parse out the QUERY_STRING properly
etc ...

Our situation is an NT intranet without servlet support yet and we need to
do some multithreaded work hence Java! :)

Hope this helps you too!

Cheers,
Jon



-----Original Message-----
From: Tom Eugelink [mailto:[EMAIL PROTECTED]]
Sent: 14 April, 2000 8:48 AM
To: [EMAIL PROTECTED]
Subject: AW: How to access environment variables such as "QUERY_STRING"?


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.

Tom



-----Urspr�ngliche Nachricht-----
Von: Cogley, Jonathan [mailto:[EMAIL PROTECTED]]
Gesendet am: Freitag, 14. April 2000 14:30
An: [EMAIL PROTECTED]
Betreff: Re: How to access environment variables such as "QUERY_STRING"?

Hans,

I am actually trying to access them from a Java Console app compiled
to an .exe and run as a CGI in IIS. - Dont ask why?! :)
(servlets or JSP are not an option for us right now ... but will be in the
future!!)

I think that I may need to read the System.in and parse it in a similar
way to a Perl program does ... however I think I still need CONTENT_LENGTH
in
order to do the read successfully.

Anyone done anything like this before??

Perhaps my question is best suited to a Java forum ...

Thanks
Jonathan



-----Original Message-----
From: Hans Bergsten [mailto:[EMAIL PROTECTED]]
Sent: 13 April, 2000 5:53 PM
To: [EMAIL PROTECTED]
Subject: Re: How to access environment variables such as "QUERY_STRING"?


"Cogley, Jonathan" wrote:
>
> Hi,
>
> Anyone know how to access environment variables?
> such as "QUERY_STRING" WITHOUT using request.getParameter,etc
>
> There is a method System.getenv() but it is deprecated ...
> The error mentions using "use properties and -D instead"
> but how do you achieve this?

Look at the Servlet API, <http://java.sun.com/products/servlet/>.
It contains explicit methods to get all info you get through environment
variables in a GCI script. Since a JSP page is actually a servlet, you
can use the complete Servlet API in your JSP pages.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
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

===========================================================================
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

===========================================================================
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

===========================================================================
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

Reply via email to