1.Spring 的Restemplate用法1,遇到形参的处理情况:
new Restemplate().getForObject("{1}/{2}/",List.class【返回类型】,url,“形参”);
2.
2.将配置文件String类型的数据转化为map
package com.tango.complexMap; import org.springframework.util.CollectionUtils; import java.io.ByteArrayInputStream; import java.util.HashMap; import java.util.Map; import java.util.Properties; public class MapTransfer { public Map transrfe() { String contents = ""; ByteArrayInputStream inputStream = new ByteArrayInputStream(contents.getBytes()); Properties properties = new Properties(); try{ properties.load(inputStream); Map map = new HashMap<>(); CollectionUtils.mergePropertiesIntoMap(properties,map); return map; } catch (Exception ex){ } } }