在Spring项目中使用REST调用时,由于我是个懒人,我的手很快就会用键盘为Spring的RestTemplate编写一个配置,就像这样:
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}这是为了避免每次都实例化它。为什么我们不将它默认配置为Bean呢?
发布于 2019-01-17 14:02:13
https://stackoverflow.com/questions/54237490
复制相似问题