摘要:
Ribbon在服务调用方使用 常用注解及范例:(服务调用方) 主类中:@Bean@LoadBalanced //在RestTemplate上加入负载均衡注解public RestTemplate restTemplate(){ return new RestTemplate();}服务调用代码:@G 阅读全文
摘要:
接收参数添加@RequestBody注解就好了。 阅读全文
摘要:
InitializingBean接口为bean提供了初始化方法的方式,它只包括afterPropertiesSet方法,凡是继承该接口的类,在初始化bean的时候都会执行该方法。 测试,如下: import org.springframework.beans.factory.Initializing 阅读全文