Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I get windows environment variables?

Posted on 2003-11-20
6
Medium Priority
?
3,412 Views
Last Modified: 2007-12-19
How do I get windows system environment variables in my .jsp file?

Thanks in advance
0
Comment
Question by:auduin
6 Comments
 
LVL 15

Accepted Solution

by:
jimmack earned 200 total points
ID: 9792321
AFAIK, there is no access to system environment variables from within an executing Java application.

Normally, I would say that you need to pass the value in from the command line:

java -Dvarname=value MyClass

In this case, the servlet container is effectively compiling and executing your JSP (convert to Servlet, compile, run), so I don't know if it's possible at all.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9792332
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9793238
jimmack is correct on this. If you mean you want to read server side env var, I used this in startup script

set >env.properties

and then use java.util.Properties to read the env.properties file. you get all your env var from there.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:auduin
ID: 9807216
Thought that was the case, was just making sure. Thank you all for your help.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9818341
;-)  No problem.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question