{"id":446,"date":"2017-08-02T15:55:46","date_gmt":"2017-08-02T15:55:46","guid":{"rendered":"http:\/\/happily70.dothome.co.kr\/?p=446"},"modified":"2017-08-02T15:55:46","modified_gmt":"2017-08-02T15:55:46","slug":"autowired","status":"publish","type":"post","link":"http:\/\/happily70.dothome.co.kr\/?p=446","title":{"rendered":"@Autowired"},"content":{"rendered":"<p>\uc758\uc874\uad00\uacc4\ub97c \uc790\ub3d9\uc124\uc815\ud560 \ub54c \uc0ac\uc6a9\ud558\uba70 \ud0c0\uc785\uc744 \uc774\uc6a9\ud558\uc5ec \uc758\uc874\ud558\ub294 \uac1d\uccb4\ub97c \uc0bd\uc785\ud574 \uc900\ub2e4. \uadf8\ub7ec\ubbc0\ub85c \ud574\ub2f9 \ud0c0\uc785\uc758 \ube48\uac1d\uccb4\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\uac70\ub098 \ub610\ub294 2\uac1c \uc774\uc0c1 \uc874\uc7ac\ud560 \uacbd\uc6b0 \uc2a4\ud504\ub9c1\uc740 \uc608\uc678\ub97c \ubc1c\uc0dd\uc2dc\ud0a4\uac8c \ub41c\ub2e4.<\/p>\n<p>options:<\/p>\n<p>required: Autowired \uc5b4\ub178\ud14c\uc774\uc158\uc744 \uc801\uc6a9\ud55c \ud504\ub85c\ud37c\ud2f0 \uc911 \ubc18\ub4dc\uc2dc \uc124\uc815\ud560 \ud544\uc694\uac00 \uc5c6\ub294 \uacbd\uc6b0\uc5d0 false\uac12\uc744 \uc8fc\uc5b4 \ud504\ub85c\ud37c\ud2f0\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub354\ub77c\ub3c4 \uc2a4\ud504\ub9c1\uc774 \uc608\uc678\ub97c \ubc1c\uc0dd\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud55c\ub2e4. \uae30\ubcf8\uac12\uc740 TRUE. ex) @Autowired(required=false)<br \/>\n\uc0ac\uc6a9\ud558\ub824\uba74 <bean class=\"org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor\" \/> \ud074\ub798\uc2a4\ub97c \ube48\uc73c\ub85c \ub4f1\ub85d\uc2dc\ucf1c\uc918\uc57c \ud55c\ub2e4. \ud574\ub2f9 \uc124\uc815 \ub300\uc2e0\uc5d0 <context:annotation-config> \ud0dc\uadf8\ub97c \uc0ac\uc6a9\ud574\ub3c4 \ub41c\ub2e4.<\/p>\n<p>@Autowired\ub97c \uc801\uc6a9\ud560 \ub54c \uac19\uc740 \ud0c0\uc785\uc758 \ube48\uc774 2\uac1c \uc774\uc0c1 \uc874\uc7ac\ud558\uac8c \ub418\uba74 \uc608\uc678\uac00 \ubc1c\uc0dd\ud558\ub294\ub370, Autowired\ub3c4 \uc774\ub7ec\ud55c \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud55c\ub2e4. \uc774\ub7f4 \ub54c @Qualifier\ub97c \uc0ac\uc6a9\ud558\uba74 \ub3d9\uc77c\ud55c \ud0c0\uc785\uc758 \ube48 \uc911 \ud2b9\uc815 \ube48\uc744 \uc0ac\uc6a9\ud558\ub3c4\ub85d \ud558\uc5ec \ubb38\uc81c\ub97c \ud574\uacb0\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre class=\"prettyprint\">public class SpringTest {\r\n      private SpringTestService service; \r\n\r\n     @Autowired public void setSpringTestService(SpringTestService service){\r\n                 this.service = service;\r\n      }\r\n }<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc758\uc874\uad00\uacc4\ub97c \uc790\ub3d9\uc124\uc815\ud560 \ub54c \uc0ac\uc6a9\ud558\uba70 \ud0c0\uc785\uc744 \uc774\uc6a9\ud558\uc5ec \uc758\uc874\ud558\ub294 \uac1d\uccb4\ub97c \uc0bd\uc785\ud574 \uc900\ub2e4. \uadf8\ub7ec\ubbc0\ub85c \ud574\ub2f9 \ud0c0\uc785\uc758 \ube48\uac1d\uccb4\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\uac70\ub098 \ub610\ub294 2\uac1c \uc774\uc0c1 \uc874\uc7ac\ud560 \uacbd\uc6b0 \uc2a4\ud504\ub9c1\uc740 \uc608\uc678\ub97c \ubc1c\uc0dd\uc2dc\ud0a4\uac8c \ub41c\ub2e4. options: required: Autowired \uc5b4\ub178\ud14c\uc774\uc158\uc744 \uc801\uc6a9\ud55c \ud504\ub85c\ud37c\ud2f0 \uc911 \ubc18\ub4dc\uc2dc \uc124\uc815\ud560 \ud544\uc694\uac00 \uc5c6\ub294 \uacbd\uc6b0\uc5d0 false\uac12\uc744 \uc8fc\uc5b4 \ud504\ub85c\ud37c\ud2f0\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub354\ub77c\ub3c4 \uc2a4\ud504\ub9c1\uc774 \uc608\uc678\ub97c \ubc1c\uc0dd\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud55c\ub2e4. \uae30\ubcf8\uac12\uc740 TRUE. ex) @Autowired(required=false) \uc0ac\uc6a9\ud558\ub824\uba74 \ud074\ub798\uc2a4\ub97c \ube48\uc73c\ub85c \ub4f1\ub85d\uc2dc\ucf1c\uc918\uc57c<\/p>\n<footer class=\"entry-footer index-entry\">\n<div class=\"post-social pull-left\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=http%3A%2F%2Fhappily70.dothome.co.kr%2F%3Fp%3D446\" target=\"_blank\" class=\"social-icons\"><i class=\"fa fa-facebook\" aria-hidden=\"true\"><\/i><\/a><a href=\"https:\/\/twitter.com\/home?status=http%3A%2F%2Fhappily70.dothome.co.kr%2F%3Fp%3D446\" target=\"_blank\" class=\"social-icons\"><i class=\"fa fa-twitter\" aria-hidden=\"true\"><\/i><\/a><a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=http%3A%2F%2Fhappily70.dothome.co.kr%2F%3Fp%3D446&#038;title=%40Autowired\" target=\"_blank\" class=\"social-icons\"><i class=\"fa fa-linkedin\" aria-hidden=\"true\"><\/i><\/a><\/div>\n<p class=\"link-more\"><a href=\"http:\/\/happily70.dothome.co.kr\/?p=446\" class=\"more-link\">Continue reading <span class=\"meta-nav\">\u2192<\/span><\/a><\/p>\n<\/footer>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,33,11],"tags":[],"class_list":["post-446","post","type-post","status-publish","format-standard","hentry","category-back-end","category-developement","category-spring"],"_links":{"self":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/446"}],"collection":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=446"}],"version-history":[{"count":1,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/446\/revisions"}],"predecessor-version":[{"id":447,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/446\/revisions\/447"}],"wp:attachment":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}