记录下几天敲代码遇到的小问题
Description:
Field restTemplate in com.lifly.controller.FreemarkerController required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.
以上错误是说找不到RestTemplate对象,需要在配置文件中配置一下,
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder){
return builder.build();
}
}
这样就好了
更多推荐
Consider defining a bean of type ‘org.springframework.web.client.RestTemplat
发布评论