简体   繁体   中英

Retriving properties values using jboss 6 properties service

I have a properties file inside conf directory in a jboss 6 server.

How i can get a group or all the key and values from that file inside my application:

<attribute name="URLList">
  ./conf/crawler.properties
</attribute>

thanks

Did this, but using java.util.Properties :

String path = System.getProperty("jboss.server.config.url") + propertiesFileName;
Properties props = new Properties();
URL url = new URL(path);
props.load(url.openStream());

The Properties class has all the neccessary methods for reading key-value-pairs (it also implements Map<Object,Object> ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM