About ResourceBundle

xiaoxiao2021-03-06  14

Sometimes some simple profiles can not be used to use XML, in fact, the ResourceBundle class has been done very well. It can even be searched for some Properties files in the JAR file in the ClassPath.

For example, place a file in the root directory in the JAR file: Test.properties, then as long as this JAR file is in the classpath. You can use such a statement to get some properties:

ResourceBundle RB = ResourceBundle.getBundle ("test"); string s = rb.getstring ("mq_server_address"); System.out.Println (s);

转载请注明原文地址:https://www.9cbs.com/read-46119.html

New Post(0)