This content has been marked as final.
Show 2 replies
-
1. Re: EJB application properties loading - best practice
wolfc Nov 4, 2011 10:07 AM (in response to pi4630)1 of 1 people found this helpfulYou can do it via resource-env-ref entries instead. Those you can inject using @Resource. Either put the value in ejb-jar.xml or let it refer to a globally configured JNDI entry.
-
2. Re: EJB application properties loading - best practice
pi4630 Nov 4, 2011 10:24 AM (in response to wolfc)I did this (from the @PostConstruct event):
{code}
ResourceBundle rb = ResourceBundle.getBundle("it.bz.prov.mercurius.util.mercurius");
Properties p = new Properties();
for (Enumeration<String> e = rb.getKeys(); e.hasMoreElements();) {
String key = (String) e.nextElement();
String value = p.getProperty(key);
System.setProperty(key, value);
}
{code}
I shall try your suggestion, because the @Resource makes a lot more sense to me.
thx