1.新建application.properties
class="java" name="code">name=solin
?2.使用以下程序获取配置信息
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("application.properties"); Properties p = new Properties(); try { p.load(inputStream); } catch (IOException e1) { e1.printStackTrace(); } System.out.println("name:"+p.getProperty("name"));
?