Re: Loading Properties file in EJB
Wednesday, August 22, 2001 07:21 AM
first, great choice of app server! second, you can setup your properties in your ejb deployment descritor with
tag. that is the preferred way you should use to get the properties to your ejbs. you can also use jndi to lookup properties from ldap servers and such. but env-entry should be sufficient to load and use and property that your ejb may need. you code that works, i.e.
this.getClass().getClassLoader().getSystemResource() will create a new object and new URL network connection for each Instance of the bean and I am not so sure that you want that. in addition, you are opening a connection just to read data that is local to your application. in my opinion, env-entry is a way to go or jndi for more advanced properties lookup.