{"id":159133,"date":"2020-09-22T05:24:45","date_gmt":"2020-09-21T21:24:45","guid":{"rendered":"http:\/\/4563.org\/?p=159133"},"modified":"2020-09-22T05:24:45","modified_gmt":"2020-09-21T21:24:45","slug":"spring-%e7%9b%b8%e5%85%b3-%e6%80%bb%e7%bb%93%e4%bb%8e%e5%a4%9a%e4%b8%aa-xml-%e6%96%87%e4%bb%b6%e4%b8%ad%e5%8a%a0%e8%bd%bd-bean-%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=159133","title":{"rendered":"Spring \u76f8\u5173 \u603b\u7ed3\u4ece\u591a\u4e2a xml \u6587\u4ef6\u4e2d\u52a0\u8f7d bean \u7684\u51e0\u79cd\u65b9\u6cd5"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Spring \u76f8\u5173 \u603b\u7ed3\u4ece\u591a\u4e2a xml \u6587\u4ef6\u4e2d\u52a0\u8f7d bean \u7684\u51e0\u79cd\u65b9\u6cd5               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gzk329 <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>ApplicationContext ctx =     new ClassPathXmlApplicationContext(\"classpath:*conf-*.xml\"); \/\/\u6216\u8005 ApplicationContext ctx =     new ClassPathXmlApplicationContext(\"classpath*:a.xml,b.xml\"); \/\/\u6216\u8005 ApplicationContext ctx = new ClassPathXmlApplicationContext(     new String[] {\"services.xml\", \"daos.xml\"}, MessengerService.class); \/\/\u6216\u8005 ApplicationContext ctx = new ClassPathXmlApplicationContext(     new String[] {\"services.xml\", \"daos.xml\"}); <\/code><\/pre>\n<p>\u8fd9\u4e2a\u7b2c\u4e09\u79cd\u662f\u4ece MesssengerService.class \u7684\u540c\u6587\u4ef6\u5939\u4e0b\u9762\u627e\uff0c\u90a3\u4e48\u8fd9\u4e2a\u7b2c\u56db\u79cd\u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3423740\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : gzk329 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9ed8\u8ba4\u90fd\u662f \u76f8\u5bf9\u8def\u5f84<br \/>\u90a3\u4e48\u7b2c\u4e8c\u79cd\u548c\u7b2c\u56db\u79cd\u662f\u6ca1\u533a\u522b\uff1f<br \/>\u7b2c\u4e09\u79cd\u6307\u4e86\u4e00\u4e2a\u4f4d\u7f6e<br \/>\u662f\u8fd9\u6837\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3423741\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lxk11153 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8211; new ClassPathXmlApplicationContext( \u8fd9\u91cc\u4e0d\u7528\u5e26 classpath:\u524d\u7f00\u7684<br \/>&#8211; 1 2 \u7684\u533a\u522b https:\/\/blog.csdn.net\/qq_30038111\/article\/details\/82116559<br \/>&#8211; 4 \u76f8\u5bf9 classpath \u4e0b\u7684&#8221;services.xml&#8221;, &#8220;daos.xml&#8221;<\/p>\n<p>&#8212;-<br \/>\u81ea\u5df1\u770b\u6e90\u7801\u6216\u8005\u6587\u6863 https:\/\/docs.spring.io\/spring-framework\/docs\/current\/spring-framework-reference\/core.html#resources-app-ctx                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Spring \u76f8\u5173 \u603b\u7ed3\u4ece\u591a\u4e2a x&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\/159133"}],"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=159133"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/159133\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159133"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}