当我尝试自动连接SpringRestTemplate时,我得到了以下错误:
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.web.client.RestTemplate] found for dependency: expected在注释驱动的环境中使用Spring4。" class="
我正在处理一个包含2个maven依赖项的Spring项目,这些依赖项都使用org.springframework.web.client.RestTemplate,所以在我的项目中使用:它触发了:
No qualifying bean of type 'org.springframework.web.client.RestTemplaterestTemplate = new RestTemplate(client
我试图覆盖ResponseErrorHandler接口,以便能够返回整个请求(状态代码、正文等)。如有除2xx以外的任何答复。我注意到,当响应不是2xx时,Spring (RestTemplate)默认返回一个异常。我不想返回异常,我只想返回一个:在一些教程之后,我发现了以下代码:public class执行情况:
HttpEntity<MultiValueMap<String, S