?
Solved

How do I get windows environment variables?

Posted on 2003-11-20
6
Medium Priority
?
3,411 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

719 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