Java
- 2 ответа
- 0 вопросов
0
Вклад в тег
public class Foo implements Serializable {
private long id;
private String name;
// standard getters and setters
}
RestTemplate restTemplate = new RestTemplate();
Foo foo = restTemplate.getForObject(url, Foo.class);
@Configuration
public class CustomMapperConfig {
public CustomMapperConfig(ApplicationContext context) {
ObjectMapper objectMapper = context.getBean(ObjectMapper.class);
//customize
}
}
context.getAutowireCapableBeanFactory()
public CustomMapperConfig(ObjectMapper objectMapper) {
//customize
}