Solved

How do I get windows environment variables?

Posted on 2003-11-20
6
3,403 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 50 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 6

Expert Comment

by:kotan
ID: 9795074
0
 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now