摘要: 直接上代码public String readConfigAsStringNotJar() throws IOException { // ClassPathResource类的构造方法接收路径名称,自动去classpath路径下找文件 ClassPathResource classPathReso 阅读全文
posted @ 2022-03-18 12:52 hwp0710 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 第1步:创建ObjectMapper对象。 创建ObjectMapper对象。它是一个可重复使用的对象。 ObjectMapper mapper = new ObjectMapper(); 第2步:反序列化JSON到对象。 从JSON对象使用readValue()方法来获取。通过JSON字符串和对象 阅读全文
posted @ 2022-03-18 12:43 hwp0710 阅读(433) 评论(0) 推荐(0) 编辑