public class CityNoUtil { private static Properties message = new Properties(); static{ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("cityno.properties"); try { message.load(is); } catch (IOException e) { e.printStackTrace(); } } public String getMessageByKey(String key){ return message.getProperty(key,AjaxResponse.ERROR); } }
java读取properties文件
最新推荐文章于 2024-07-24 21:47:59 发布