1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Config configHome=null;
Hashtable<String, String> ht = new Hashtable<String, String>();
ht.put(InitialContext.INITIAL_CONTEXT_FACTORY,
monprojet.INITIAL_CONTEXT_FACTORY);
ht.put(InitialContext.PROVIDER_URL, monprojet.PROVIDER_URL);
ht.put(InitialContext.URL_PKG_PREFIXES, monprojet.URL_PKG_PREFIXES);
InitialContext ctx = null;
try {
ctx = new InitialContext(ht);
System.out.println(getEnv(ctx));
}
catch (NamingException ne) {}
configHome = (Config)ctx.lookup("Ejb3/ConfigBean/remote");
System.out.println(configHome.loadProperty("code")); |
Partager