spring @Required

spring的依赖检查功能:

在bean的xml配置文件中 : dependency-check=simple / Object / all ,检查的所有属性,非必init的属性也会被报错


@Required 指定需要init的 :

RequiredAnnotationBeanPostProcesser 是spring bean后处理器,检查带有@Required注解的属性是否设置

(但是没有在这个注解中看到require的属性的init值)

image.png

( 如上配置的bean没有name 和 id , 作为spring使用的bean)


image.png

猜你喜欢

转载自blog.51cto.com/9153232/2154662
今日推荐