[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Reading Evironment variable in context.xml

Posted on 2009-02-08
3
Medium Priority
?
1,520 Views
Last Modified: 2013-11-24
Hello everybody,

this is my first question here (but won't be my last).

I've put the path to a networkshare in an environment variable of my context.xml in a Java Web Project. The path contains an '$'-sign.

When I read this variable into my servlet the '$' is ommitted. I've tried to escape it, but this doesn't seem to help.

As a temporarily solution I've created a workaround by substituting the '$' by another symbol and then replace this in my servlet.

But can someone tell me what is going on here?

Thanks.
xml ==>
 
<Environment name="path_to_networtkshare" 
       value="\\\\servername\\c$\\Java\\path"
       type="java.lang.String" override="false"/>
 
servlet ==>
 
String folderPathIZ;
Context ctx = new InitialContext();
folderPathAZ = (String)ctx.lookup("java:comp/env/path_to_networtkshare");

Open in new window

0
Comment
Question by:De_Cisse
3 Comments
 
LVL 13

Expert Comment

by:MicheleMarcon
ID: 23588605
Did you try with unicode \u0024

?
0
 

Author Comment

by:De_Cisse
ID: 23588657
Do I simply replace: value="\\\\servername\\c$\\Java\\path" with value="\\\\servername\\c\u0024\\Java\\path" ?

In that case, this doesn't work.

0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 23588719
$$

(I'm guessing)

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

873 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