
java
阿良@
这个作者很懒,什么都没留下…
展开
-
通过ApplicationContextAware 获取bean
@通过ApplicationContextAware 获取beanpackage cn.piesat.ias.util;import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframework.s原创 2021-11-24 18:16:25 · 391 阅读 · 0 评论 -
RestTemplate exchange
@GetMapping("/putByText")@ApiOperation(value = "远程更新资源", position = 1, httpMethod = "GET", response = Result.class)public Result putByText(@ApiParam(value = "text参数", name = "text") @RequestParam(name = "text") String text){ MultiValueMap<String,原创 2021-11-24 17:11:54 · 741 阅读 · 0 评论 -
Spring的@PostConstruct和Aware接口实现原理
@PostConstruct是由CommonAnnotationBeanPostProcessor类实现的。一、CommonAnnotationBeanPostProcessor是什么时候加载进去的呢?我们首先看到CommonAnnotationBeanPostProcessor是spring context下的包,说明是spring自带的类。我们就大胆猜想,它是spring的创世纪类,即internal类。我们怎么验证呢?我们知道spring自带的创世纪类是在下面的构造方法里面:public Ann转载 2021-07-24 11:56:33 · 578 阅读 · 0 评论 -
多态的经典实例分析
实例代码:1.类Apackage polymorphic;public class A {public String show(D obj) {return ("A and D");}public String show(A obj) {return ("A and A");}}2.类Bpackage...转载 2019-07-08 14:50:23 · 294 阅读 · 0 评论