{"id":352498,"date":"2021-02-16T22:17:34","date_gmt":"2021-02-16T14:17:34","guid":{"rendered":"http:\/\/4563.org\/?p=352498"},"modified":"2021-02-16T22:17:34","modified_gmt":"2021-02-16T14:17:34","slug":"%e6%80%8e%e4%b9%88%e6%89%8d%e8%83%bd%e5%ae%89%e5%85%a8%e7%9a%84%e7%bb%99-spring-bean-%e7%9a%84%e9%9d%99%e6%80%81%e5%8f%98%e9%87%8f%e6%b3%a8%e5%85%a5%e5%80%bc%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=352498","title":{"rendered":"\u600e\u4e48\u624d\u80fd\u5b89\u5168\u7684\u7ed9 spring bean \u7684\u9759\u6001\u53d8\u91cf\u6ce8\u5165\u503c\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u600e\u4e48\u624d\u80fd\u5b89\u5168\u7684\u7ed9 spring bean \u7684\u9759\u6001\u53d8\u91cf\u6ce8\u5165\u503c\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : luxinfl <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u7528\u8fc7\u6ce8\u5165\u975e\u9759\u6001 setter \u65b9\u6cd5\u7ed9\u9759\u6001\u53d8\u91cf\u6ce8\u5165\uff0c\u4f46\u662f jekkins \u626b\u63cf\u4ee3\u7801\u7684\u65f6\u5019\uff0c\u4f1a\u63d0\u793a\u4e00\u4e2a\u5b89\u5168\u95ee\u9898\uff0c\u7136\u540e\u8ba9\u6211\u4eec\u4fee\u6539\u3002\u8fd9\u4e2a\u6709\u89e3\u9ebd\u3002\u3002\u3002\u3002\u3002\u3002 \u8bf4\u4e00\u4e0b\u573a\u666f\uff0c\u6211\u9700\u8981\u5728 yml \u914d\u7f6e\u4e00\u4e2a\u8fc7\u671f\u65f6\u95f4\uff0c\u7136\u540e\u5728\u4e00\u4e2a\u5355\u4f8b\u91cc\u9762\u7528\u8fd9\u4e2a\u503c\u521d\u59cb\u5316\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5330673\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : beichenhpy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Component<br \/>public class Test {<\/p>\n<p> private static AddressService addressService;<br \/> @Autowired<br \/> public Test(AddressService addressService){<br \/> Test.addressService = addressService;<br \/> }<\/p>\n<p> public static void test(){<br \/> addressService.addressLog();<br \/> }<br \/>}<br \/>\u4e00\u5b9a\u8981\u7528 setter \u5417\uff1f\u6211\u7528\u6784\u9020\u51fd\u6570\u6ce8\u5165\u7684\u4e5f\u53ef\u4ee5\u7528\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5330674\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chendy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u89e3\u6570\u636e\u7684\u7c7b\u5b9e\u73b0 InitializingBean\uff0c\u5728 afterPropertiesSet \u91cc\u628a\u4e1c\u897f set \u7ed9\u9759\u6001\u53d8\u91cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5330675\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : luxinfl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @beichenhpy \u8fd9\u4e2a\u4e0d\u592a\u884c\uff0c\u56e0\u4e3a\u6709\u53e6\u4e00\u4e2a\u9759\u6001\u53d8\u91cf\u4f1a\u7528\u5230\u8fd9\u4e2a\u53c2\u6570\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5330676\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : luxinfl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @chendy \u8fd9\u4e2a\u662f\u4e0d\u662f\u53ea\u80fd\u7528\u5728\u6210\u5458\u53d8\u91cf\u554a\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u600e\u4e48\u624d\u80fd\u5b89\u5168\u7684\u7ed9 spring b&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/352498"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352498"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/352498\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352498"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}