{"id":89273,"date":"2026-08-02T19:17:02","date_gmt":"2026-08-02T11:17:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89273.html"},"modified":"2026-08-02T19:17:02","modified_gmt":"2026-08-02T11:17:02","slug":"spring-%e8%87%aa%e5%8a%a8%e8%a3%85%e9%85%8d%e7%9a%84-5-%e7%a7%8d%e6%a8%a1%e5%bc%8f%ef%bc%9abyname%e3%80%81bytype-%e5%88%b0%e5%ba%95%e6%9c%89%e4%bb%80%e4%b9%88%e5%8c%ba%e5%88%ab%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89273.html","title":{"rendered":"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f"},"content":{"rendered":"<p>Spring \u81ea\u52a8\u88c5\u914d\u8981\u56de\u7b54\u7684\u95ee\u9898\u662f&#xff1a;<\/p>\n<p>\u7ed9\u5bf9\u8c61\u7684\u5c5e\u6027\u8d4b\u503c\u65f6&#xff0c;\u5bb9\u5668\u5230\u5e95\u6309\u4ec0\u4e48\u89c4\u5219\u628a\u4f9d\u8d56\u6ce8\u5165\u8fdb\u6765\u3002<\/p>\n<p>\u5f88\u591a\u4eba\u521a\u5b66 Spring \u65f6\u542c\u8fc7 byName\u3001byType&#xff0c;\u4f46\u771f\u6b63\u5f00\u53d1\u4e45\u4e86&#xff0c;\u5bf9\u8fd9\u51e0\u79cd\u88c5\u914d\u65b9\u5f0f\u7684\u7ec6\u8282\u53cd\u800c\u8bf4\u4e0d\u6e05\u4e86\u3002<\/p>\n<p>\u800c\u8fd9\u53c8\u6070\u597d\u662f\u9762\u8bd5\u7231\u8003\u7684\u57fa\u7840\u9898&#xff0c;\u7528\u6765\u5224\u65ad\u4f60\u7684 Spring \u529f\u5e95\u624e\u4e0d\u624e\u5b9e\u3002<\/p>\n<p>Spring \u4e00\u5171\u63d0\u4f9b\u4e86 5 \u79cd\u81ea\u52a8\u88c5\u914d\u6a21\u5f0f&#xff1a;no\u3001byName\u3001byType\u3001constructor\u3001autodetect\u3002<\/p>\n<p>\u4e0b\u9762\u9010\u4e2a\u8bf4\u6e05\u695a\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260802111658-6a6f272a65c05.png\" alt=\"\" \/><\/p>\n<h3>\u4e00\u3001no&#xff1a;\u9ed8\u8ba4&#xff0c;\u4e0d\u81ea\u52a8\u88c5\u914d<\/h3>\n<p>no \u662f\u9ed8\u8ba4\u6a21\u5f0f&#xff0c;\u8868\u793a\u4e0d\u505a\u81ea\u52a8\u88c5\u914d&#xff0c;\u4f9d\u8d56\u5168\u9760\u624b\u52a8\u7528 ref \u6307\u5b9a\u3002<\/p>\n<p>\u65e5\u5e38\u5f00\u53d1\u57fa\u672c\u4e0d\u4f1a\u663e\u5f0f\u914d\u5b83&#xff0c;\u56e0\u4e3a\u4e0d\u5199 autowire \u5c5e\u6027\u65f6&#xff0c;\u8d70\u7684\u5c31\u662f\u8fd9\u4e2a\u9ed8\u8ba4\u884c\u4e3a\u3002<\/p>\n<h3>\u4e8c\u3001byName&#xff1a;\u6309\u540d\u79f0\u88c5\u914d<\/h3>\n<p>byName \u662f\u6309\u5c5e\u6027\u540d\u5339\u914d\u2014\u2014\u5bb9\u5668\u53bb\u67e5\u627e\u4e0e\u5f53\u524d bean \u5c5e\u6027\u540c\u540d\u7684 bean&#xff0c;\u627e\u5230\u5c31\u6ce8\u5165\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50&#xff0c;bean \u91cc\u6709\u4e2a\u5c5e\u6027\u53eb userDao&#xff0c;\u5bb9\u5668\u5c31\u53bb\u627e id&#xff08;\u6216 name&#xff09;\u4e5f\u53eb userDao \u7684\u90a3\u4e2a bean \u6ce8\u5165\u8fdb\u6765\u3002<\/p>\n<p>\u5728 Spring XML \u81ea\u52a8\u88c5\u914d\u6a21\u5f0f\u4e2d&#xff0c;byName \u76f8\u6bd4 byType \u66f4\u5bb9\u6613\u63a7\u5236\u3002<\/p>\n<p>\u4f46\u5728\u73b0\u4ee3 Spring Boot \u9879\u76ee\u4e2d&#xff0c;\u8fd9\u51e0\u79cd XML \u81ea\u52a8\u88c5\u914d\u65b9\u5f0f\u5df2\u7ecf\u8f83\u5c11\u4f7f\u7528\u3002<\/p>\n<h3>\u4e09\u3001byType&#xff1a;\u6309\u7c7b\u578b\u88c5\u914d<\/h3>\n<p>byType \u662f\u6309\u7c7b\u578b\u5339\u914d\u2014\u2014\u5bb9\u5668\u53bb\u627e\u4e0e\u5c5e\u6027\u7c7b\u578b\u4e00\u81f4\u7684 bean \u6ce8\u5165\u3002<\/p>\n<p>\u95ee\u9898\u4e5f\u6b63\u51fa\u5728\u8fd9\u91cc&#xff1a;<\/p>\n<p>\u5982\u679c\u627e\u5230\u591a\u4e2a\u76f8\u540c\u7c7b\u578b\u7684 Bean&#xff0c;Spring \u65e0\u6cd5\u5224\u65ad\u5e94\u8be5\u6ce8\u5165\u54ea\u4e00\u4e2a&#xff0c;\u4f1a\u629b\u51fa NoUniqueBeanDefinitionException\u3002<\/p>\n<p>\u6240\u4ee5\u7528 byType \u6709\u4e2a\u524d\u63d0&#xff1a;<\/p>\n<p>\u540c\u4e00\u7c7b\u578b\u5728\u5bb9\u5668\u91cc\u5fc5\u987b\u552f\u4e00\u3002<\/p>\n<p>\u53ea\u8981\u53ef\u80fd\u51fa\u73b0\u591a\u4e2a\u540c\u7c7b\u578b bean&#xff0c;\u5c31\u66f4\u9002\u5408\u6539\u7528 byName \u628a\u540d\u79f0\u6307\u5b9a\u6e05\u695a\u3002<\/p>\n<p>\u4e24\u8005\u5bf9\u6bd4&#xff0c;byName \u66f4\u7a33&#xff0c;\u56e0\u4e3a\u5b83\u6309\u540d\u5b57\u7cbe\u786e\u5b9a\u4f4d&#xff1b;<\/p>\n<p>byType \u7684\u5339\u914d\u8303\u56f4\u662f\u6574\u4e2a\u5bb9\u5668\u91cc\u6240\u6709\u8be5\u7c7b\u578b\u7684 bean&#xff0c;\u5bb9\u6613\u8e29\u5751\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260802111659-6a6f272b71507.png\" alt=\"\" \/><\/p>\n<h3>\u56db\u3001constructor&#xff1a;\u6309\u6784\u9020\u5668\u53c2\u6570\u7c7b\u578b\u88c5\u914d<\/h3>\n<p>constructor \u548c byType \u4e00\u6837\u662f\u6309\u7c7b\u578b\u5339\u914d&#xff0c;\u533a\u522b\u5728\u4e8e\u5b83\u4f5c\u7528\u4e8e\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u3002<\/p>\n<p>\u5b83\u8981\u6c42 Spring \u80fd\u591f\u660e\u786e\u627e\u5230\u5339\u914d\u7684\u6784\u9020\u53c2\u6570\u4f9d\u8d56\u3002<\/p>\n<p>\u5982\u679c\u5b58\u5728\u591a\u4e2a\u5019\u9009 Bean \u4e14\u65e0\u6cd5\u786e\u5b9a\u5177\u4f53\u6ce8\u5165\u5bf9\u8c61&#xff0c;\u5c31\u4f1a\u5bfc\u81f4\u88c5\u914d\u5931\u8d25\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u79cd\u5bb9\u6613\u7ffb\u8f66\u7684\u60c5\u51b5&#xff1a;<\/p>\n<p>\u5982\u679c\u5b58\u5728\u591a\u4e2a\u6784\u9020\u5668&#xff0c;Spring \u9700\u8981\u6839\u636e\u6784\u9020\u53c2\u6570\u8fdb\u884c\u5339\u914d\u3002<\/p>\n<p>\u5982\u679c\u5b58\u5728\u591a\u4e2a\u6ee1\u8db3\u6761\u4ef6\u7684\u6784\u9020\u5668&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u65e0\u6cd5\u786e\u5b9a\u4f7f\u7528\u54ea\u4e2a\u6784\u9020\u5668\u3002<\/p>\n<p>\u6b63\u56e0\u4e3a\u7ea6\u675f\u82db\u523b&#xff0c;\u8fd9\u79cd\u6a21\u5f0f\u7528\u5f97\u76f8\u5bf9\u5c11\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260802111700-6a6f272c367b9.png\" alt=\"\" \/><\/p>\n<h3>\u4e94\u3001autodetect&#xff1a;\u81ea\u52a8\u68c0\u6d4b<\/h3>\n<p>autodetect \u4ea4\u7ed9 Spring \u81ea\u5df1\u5224\u65ad&#xff1a;<\/p>\n<p>\u5982\u679c\u7c7b\u6709\u9ed8\u8ba4\u6784\u9020\u65b9\u6cd5&#xff0c;\u5c31\u7528 byType \u88c5\u914d&#xff1b;<\/p>\n<p>\u6ca1\u6709\u9ed8\u8ba4\u6784\u9020\u65b9\u6cd5&#xff0c;\u5c31\u7528 constructor \u88c5\u914d\u3002<\/p>\n<p>\u5339\u914d\u5230\u54ea\u79cd\u89c4\u5219\u5c31\u7528\u54ea\u79cd&#xff0c;\u4e0d\u9700\u8981\u4eba\u4e3a\u6307\u5b9a\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260802111700-6a6f272cc6636.png\" alt=\"\" \/><\/p>\n<p>\u5c0f\u8d34\u58eb&#xff1a;<\/p>\n<p>autodetect \u662f Spring \u65e9\u671f XML \u914d\u7f6e\u4e2d\u7684\u81ea\u52a8\u88c5\u914d\u6a21\u5f0f&#xff0c;\u5728 Spring 3.0 \u540e\u5df2\u7ecf\u5e9f\u5f03&#xff0c;\u73b0\u4ee3\u9879\u76ee\u57fa\u672c\u4e0d\u4f1a\u4f7f\u7528\u3002<\/p>\n<h3>\u600e\u4e48\u9009&#xff1f;<\/h3>\n<table>\n<tr>\u6a21\u5f0f\u5339\u914d\u4f9d\u636e\u7279\u70b9\u9002\u7528<\/tr>\n<tbody>\n<tr>\n<td>no<\/td>\n<td>\u624b\u52a8 ref<\/td>\n<td>\u9ed8\u8ba4&#xff0c;\u4e0d\u81ea\u52a8\u88c5\u914d<\/td>\n<td>\u4e0d\u60f3\u7528\u81ea\u52a8\u88c5\u914d\u65f6<\/td>\n<\/tr>\n<tr>\n<td>byName<\/td>\n<td>\u5c5e\u6027\u540d<\/td>\n<td>\u540d\u79f0\u7cbe\u786e&#xff0c;\u5bb9\u6613\u63a7\u5236<\/td>\n<td>XML \u914d\u7f6e\u4e2d\u9700\u8981\u6309\u540d\u79f0\u5339\u914d\u65f6<\/td>\n<\/tr>\n<tr>\n<td>byType<\/td>\n<td>\u5c5e\u6027\u7c7b\u578b<\/td>\n<td>\u540c\u7c7b\u578b\u5fc5\u987b\u552f\u4e00&#xff0c;\u5426\u5219\u62a5&#034;\u591a\u4e2a\u5339\u914d&#034;\u5f02\u5e38<\/td>\n<td>\u7c7b\u578b\u552f\u4e00\u4e14\u56fe\u7701\u4e8b\u65f6<\/td>\n<\/tr>\n<tr>\n<td>constructor<\/td>\n<td>\u6784\u9020\u53c2\u6570\u7c7b\u578b<\/td>\n<td>\u8981\u6c42\u552f\u4e00&#xff0c;\u6784\u9020\u5668\u91cd\u590d\u4f1a\u62a5\u9519<\/td>\n<td>\u8f83\u5c11\u7528<\/td>\n<\/tr>\n<tr>\n<td>autodetect<\/td>\n<td>\u81ea\u52a8\u68c0\u6d4b<\/td>\n<td>\u6709\u9ed8\u8ba4\u6784\u9020\u8d70 byType&#xff0c;\u5426\u5219\u8d70 constructor<\/td>\n<td>\u4ea4\u7ed9 Spring \u5224\u65ad<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\u8ba8\u8bba Spring XML \u65f6\u4ee3\u7684\u81ea\u52a8\u88c5\u914d\u6a21\u5f0f&#xff0c;byName \u548c byType \u4f7f\u7528\u8f83\u591a\u3002<\/p>\n<p>\u4f46\u5728\u73b0\u4ee3 Spring Boot \u9879\u76ee\u4e2d&#xff0c;\u66f4\u63a8\u8350\u663e\u5f0f\u6ce8\u5165&#xff0c;\u4f8b\u5982\u6784\u9020\u5668\u6ce8\u5165\u3001&#064;Autowired\u3001&#064;Resource&#xff0c;\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u66f4\u597d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring \u81ea\u52a8\u88c5\u914d\u8981\u56de\u7b54\u7684\u95ee\u9898\u662f&#xff1a;<br \/>\n\u7ed9\u5bf9\u8c61\u7684\u5c5e\u6027\u8d4b\u503c\u65f6&#xff0c;\u5bb9\u5668\u5230\u5e95\u6309\u4ec0\u4e48\u89c4\u5219\u628a\u4f9d\u8d56\u6ce8\u5165\u8fdb\u6765\u3002<br \/>\n\u5f88\u591a\u4eba\u521a\u5b66 Spring \u65f6\u542c\u8fc7 byName\u3001byType&#xff0c;\u4f46\u771f\u6b63\u5f00\u53d1\u4e45\u4e86&#xff0c;\u5bf9\u8fd9\u51e0\u79cd\u88c5\u914d\u65b9\u5f0f\u7684\u7ec6\u8282\u53cd\u800c\u8bf4\u4e0d\u6e05\u4e86\u3002<br \/>\n\u800c\u8fd9\u53c8\u6070\u597d\u662f\u9762\u8bd5\u7231\u8003\u7684\u57fa\u7840\u9898&#xff0c;\u7528\u6765\u5224\u65ad\u4f60\u7684 Spring \u529f\u5e95\u624e\u4e0d\u624e\u5b9e\u3002<br \/>\nSpring \u4e00\u5171\u63d0\u4f9b\u4e86 5 \u79cd\u81ea\u52a8\u88c5\u914d\u6a21\u5f0f&#xff1a;no\u3001byName\u3001byType\u3001constructor\u3001aut<\/p>\n","protected":false},"author":2,"featured_media":89269,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,101,292],"topic":[],"class_list":["post-89273","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-spring","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/89273.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Spring \u81ea\u52a8\u88c5\u914d\u8981\u56de\u7b54\u7684\u95ee\u9898\u662f&#xff1a; \u7ed9\u5bf9\u8c61\u7684\u5c5e\u6027\u8d4b\u503c\u65f6&#xff0c;\u5bb9\u5668\u5230\u5e95\u6309\u4ec0\u4e48\u89c4\u5219\u628a\u4f9d\u8d56\u6ce8\u5165\u8fdb\u6765\u3002 \u5f88\u591a\u4eba\u521a\u5b66 Spring \u65f6\u542c\u8fc7 byName\u3001byType&#xff0c;\u4f46\u771f\u6b63\u5f00\u53d1\u4e45\u4e86&#xff0c;\u5bf9\u8fd9\u51e0\u79cd\u88c5\u914d\u65b9\u5f0f\u7684\u7ec6\u8282\u53cd\u800c\u8bf4\u4e0d\u6e05\u4e86\u3002 \u800c\u8fd9\u53c8\u6070\u597d\u662f\u9762\u8bd5\u7231\u8003\u7684\u57fa\u7840\u9898&#xff0c;\u7528\u6765\u5224\u65ad\u4f60\u7684 Spring \u529f\u5e95\u624e\u4e0d\u624e\u5b9e\u3002 Spring \u4e00\u5171\u63d0\u4f9b\u4e86 5 \u79cd\u81ea\u52a8\u88c5\u914d\u6a21\u5f0f&#xff1a;no\u3001byName\u3001byType\u3001constructor\u3001aut\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89273.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-02T11:17:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260802111658-6a6f272a65c05.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89273.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89273.html\",\"name\":\"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-02T11:17:02+00:00\",\"dateModified\":\"2026-08-02T11:17:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89273.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89273.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89273.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/89273.html","og_locale":"zh_CN","og_type":"article","og_title":"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Spring \u81ea\u52a8\u88c5\u914d\u8981\u56de\u7b54\u7684\u95ee\u9898\u662f&#xff1a; \u7ed9\u5bf9\u8c61\u7684\u5c5e\u6027\u8d4b\u503c\u65f6&#xff0c;\u5bb9\u5668\u5230\u5e95\u6309\u4ec0\u4e48\u89c4\u5219\u628a\u4f9d\u8d56\u6ce8\u5165\u8fdb\u6765\u3002 \u5f88\u591a\u4eba\u521a\u5b66 Spring \u65f6\u542c\u8fc7 byName\u3001byType&#xff0c;\u4f46\u771f\u6b63\u5f00\u53d1\u4e45\u4e86&#xff0c;\u5bf9\u8fd9\u51e0\u79cd\u88c5\u914d\u65b9\u5f0f\u7684\u7ec6\u8282\u53cd\u800c\u8bf4\u4e0d\u6e05\u4e86\u3002 \u800c\u8fd9\u53c8\u6070\u597d\u662f\u9762\u8bd5\u7231\u8003\u7684\u57fa\u7840\u9898&#xff0c;\u7528\u6765\u5224\u65ad\u4f60\u7684 Spring \u529f\u5e95\u624e\u4e0d\u624e\u5b9e\u3002 Spring \u4e00\u5171\u63d0\u4f9b\u4e86 5 \u79cd\u81ea\u52a8\u88c5\u914d\u6a21\u5f0f&#xff1a;no\u3001byName\u3001byType\u3001constructor\u3001aut","og_url":"https:\/\/www.wsisp.com\/helps\/89273.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-02T11:17:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260802111658-6a6f272a65c05.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/89273.html","url":"https:\/\/www.wsisp.com\/helps\/89273.html","name":"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-02T11:17:02+00:00","dateModified":"2026-08-02T11:17:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89273.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89273.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89273.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Spring \u81ea\u52a8\u88c5\u914d\u7684 5 \u79cd\u6a21\u5f0f\uff1abyName\u3001byType \u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=89273"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89273\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/89269"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89273"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}