How can I retrieve a list of items from a context.xml file?
Here is the context:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/mypath">
<Environment name="url" value="http://www.google.com"
type="java.lang.String" override="false"/>
<Environment name="user" value="user"
type="java.lang.String" override="false"/>
<Environment name="password" value="password"
type="java.lang.String" override="false"/>
</Context>
I can access the individual items using this code:
InitialContext initialContext = new InitialContext();
javax.naming.Context context = (javax.naming.Context) initialContext.lookup("java:comp/env");
String baj_url = (String)context.lookup("url");
But how can I get a collection of all three items without specifiying the items by name? Is there a way to loop through them all?