{"id":577,"date":"2023-03-23T21:28:47","date_gmt":"2023-03-23T13:28:47","guid":{"rendered":""},"modified":"2023-03-23T21:28:47","modified_gmt":"2023-03-23T13:28:47","slug":"SpringBoot \u4ecb\u7ecd","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/577.html","title":{"rendered":"SpringBoot \u4ecb\u7ecd"},"content":{"rendered":"
\n

SpringBoot \u4ecb\u7ecd<\/h1>\n<\/div>\n

Spring\u4e0eSpring Boot\u5bf9\u6bd4 <\/h2>\n
\n Spring: <\/strong> Spring\u6846\u67b6\u662f\u6700\u6d41\u884c\u7684Java\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\u3002 Spring\u6846\u67b6\u7684\u4e3b\u8981\u529f\u80fd\u662f
\n \u4f9d\u8d56\u6ce8\u5165<\/strong>\u6216
\n \u63a7\u5236\u53cd\u8f6c<\/strong>(IoC)\u3002\u501f\u52a9Spring Framework\uff0c\u6211\u4eec\u53ef\u4ee5\u5f00\u53d1\u4e00\u4e2a
\n \u677e\u8026\u5408<\/strong>\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u5982\u679c\u7eaf\u7cb9\u5b9a\u4e49\u5e94\u7528\u7a0b\u5e8f\u7c7b\u578b\u6216\u7279\u5f81\uff0c\u6700\u597d\u4f7f\u7528\u3002\n<\/div>\n
\n SpringBoot: <\/strong> Spring Boot\u662fSpring Framework\u7684\u6a21\u5757\u3002\u5b83\u5141\u8bb8\u6211\u4eec\u6784\u5efa\u5177\u6709\u6700\u5c11\u914d\u7f6e\u6216\u96f6\u914d\u7f6e\u7684\u72ec\u7acb\u5e94\u7528\u7a0b\u5e8f\u3002\u5982\u679c\u6211\u4eec\u8981\u5f00\u53d1\u4e00\u4e2a\u7b80\u5355\u7684\u57fa\u4e8eSpring\u7684\u5e94\u7528\u7a0b\u5e8f\u6216RESTful\u670d\u52a1\uff0c\u6700\u597d\u4f7f\u7528\u5b83\u3002\n<\/div>\n
\n Spring\u548cSpring Boot\u4e4b\u95f4\u7684\u4e3b\u8981\u6bd4\u8f83\u8ba8\u8bba\u5982\u4e0b:\n<\/div>\n\n\n\n\n\n\n\n\n\n\n\n
Spring<\/td>\nSpring Boot <\/td>\n<\/tr>\n
Spring Framework<\/strong>\u662f\u7528\u4e8e\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u7684\u5e7f\u6cdb\u4f7f\u7528\u7684Java EE\u6846\u67b6\u3002<\/td>\n SpringBoot Framework <\/strong>\u88ab\u5e7f\u6cdb\u7528\u4e8e\u5f00\u53d1 REST API <\/strong>\u3002<\/td>\n<\/tr>\n
\u5b83\u65e8\u5728\u7b80\u5316Java EE\u5f00\u53d1\uff0c\u4ece\u800c\u4f7f\u5f00\u53d1\u4eba\u5458\u66f4\u52a0\u9ad8\u6548\u3002<\/td>\n\u5b83\u65e8\u5728\u7f29\u77ed\u4ee3\u7801\u957f\u5ea6\uff0c\u5e76\u63d0\u4f9b\u5f00\u53d1 Web\u5e94\u7528\u7a0b\u5e8f<\/strong>\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u3002<\/td>\n<\/tr>\n
Spring Framework\u7684\u4e3b\u8981\u529f\u80fd\u662f\u4f9d\u8d56\u6ce8\u5165<\/strong>\u3002<\/td>\n Spring Boot\u7684\u4e3b\u8981\u529f\u80fd\u662f\u81ea\u52a8\u914d\u7f6e<\/strong>\u3002\u5b83\u4f1a\u6839\u636e\u9700\u6c42\u81ea\u52a8\u914d\u7f6e\u7c7b\u3002<\/td>\n<\/tr>\n
\u901a\u8fc7\u5141\u8bb8\u6211\u4eec\u5f00\u53d1\u677e\u8026\u5408<\/strong>\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u4e8b\u60c5\u53d8\u5f97\u66f4\u7b80\u5355\u3002<\/td>\n\u5b83\u6709\u52a9\u4e8e\u521b\u5efa\u914d\u7f6e\u66f4\u5c11\u7684\u72ec\u7acb<\/strong>\u5e94\u7528\u3002<\/td>\n<\/tr>\n
\u5f00\u53d1\u4eba\u5458\u7f16\u5199\u4e86\u5927\u91cf\u4ee3\u7801(\u6a21\u677f\u4ee3\u7801<\/strong>)\u6765\u5b8c\u6210\u6700\u5c0f\u7684\u4efb\u52a1\u3002<\/td>\n\u5b83\u51cf\u5c11<\/strong>\u6837\u677f\u4ee3\u7801\u3002<\/td>\n<\/tr>\n
\u8981\u6d4b\u8bd5Spring\u9879\u76ee\uff0c\u6211\u4eec\u9700\u8981\u663e\u5f0f\u8bbe\u7f6e\u670d\u52a1\u5668\u3002<\/td>\n SpringBoot\u63d0\u4f9b\u4e86\u5d4c\u5165\u5f0f\u670d\u52a1\u5668<\/strong>\uff0c\u4f8b\u5982 Jetty <\/strong>\u548c Tomcat <\/strong>\u7b49\u3002<\/td>\n<\/tr>\n
\u5b83\u4e0d\u652f\u6301\u5185\u5b58\u6570\u636e\u5e93\u3002<\/td>\n\u5b83\u63d0\u4f9b\u4e86\u591a\u4e2a\u63d2\u4ef6\u6765\u5904\u7406\u5d4c\u5165\u5f0f\u548c\u5185\u5b58\u4e2d<\/strong>\u6570\u636e\u5e93\uff0c\u4f8b\u5982 H2 <\/strong>\u3002<\/td>\n<\/tr>\n
\u5f00\u53d1\u4eba\u5458\u5728 pom.xml <\/strong>\u4e2d\u4e3aSpring\u9879\u76ee\u624b\u52a8\u5b9a\u4e49\u4f9d\u8d56\u9879\u3002<\/td>\n Spring Boot\u5728pom.xml\u6587\u4ef6\u4e2d\u5e26\u6709 starter <\/strong>\u6982\u5ff5\uff0c\u8be5\u6982\u5ff5\u5185\u90e8\u8d1f\u8d23\u6839\u636eSpring Boot\u8981\u6c42\u4e0b\u8f7d\u4f9d\u8d56\u9879 JAR <\/strong>\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Spring Boot\u4e0eSpring MVC <\/h2>\n
\n Spring Boot: <\/strong> SpringBoot\u4f7f\u5f97\u5feb\u901f\u5f15\u5bfc\u548c\u5f00\u59cb\u5f00\u53d1\u57fa\u4e8eSpring\u7684\u8fc7\u7a0b\u53d8\u5f97\u5bb9\u6613\u3002\u5e94\u7528\u3002\u5b83\u907f\u514d\u4e86\u5f88\u591a\u6837\u677f\u4ee3\u7801\u3002\u5b83\u9690\u85cf\u4e86\u5f88\u591a\u590d\u6742\u7684\u4fe1\u606f\uff0c\u56e0\u6b64\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5feb\u901f\u5165\u95e8\u5e76\u8f7b\u677e\u5f00\u53d1\u57fa\u4e8eSpring\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\n<\/div>\n
\n Spring MVC: <\/strong> Spring MVC\u662f\u7528\u4e8e\u4ee5\u4e0b\u65b9\u9762\u7684Web MVC\u6846\u67b6: \u6784\u5efaWeb\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u5305\u542b\u8bb8\u591a\u7528\u4e8e\u5404\u79cd\u529f\u80fd\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u8fd9\u662f\u4e00\u4e2a\u9762\u5411HTTP\u7684Web\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\u3002\n<\/div>\n
\n Spring Boot\u548cSpring MVC\u51fa\u4e8e\u4e0d\u540c\u7684\u76ee\u7684\u800c\u5b58\u5728\u3002\u4e0b\u9762\u8ba8\u8bba\u4e86Spring Boot\u548cSpring MVC\u4e4b\u95f4\u7684\u4e3b\u8981\u6bd4\u8f83:\n<\/div>\n\n\n\n\n\n\n\n\n\n
SpringBoot <\/td>\n SpringMVC <\/td>\n<\/tr>\n
SpringBoot <\/strong>\u662fSpring\u7684\u6a21\u5757\uff0c\u7528\u4e8e\u4f7f\u7528\u5408\u7406\u7684\u9ed8\u8ba4\u503c\u6253\u5305\u57fa\u4e8eSpring\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/td>\n SpringMVC <\/strong>\u662fSpring\u6846\u67b6\u4e0b\u57fa\u4e8e\u6a21\u578b\u89c6\u56fe\u63a7\u5236\u5668\u7684Web\u6846\u67b6\u3002<\/td>\n<\/tr>\n
\u5b83\u63d0\u4f9b\u4e86\u7528\u4e8e\u6784\u5efa Spring-powered <\/strong>\u6846\u67b6\u7684\u9ed8\u8ba4\u914d\u7f6e\u3002<\/td>\n\u5b83\u63d0\u4f9b\u4e86\u6613\u4e8e\u4f7f\u7528<\/strong>\u529f\u80fd\u6765\u6784\u5efaWeb\u5e94\u7528\u7a0b\u5e8f\u3002<\/td>\n<\/tr>\n
\u65e0\u9700\u624b\u52a8\u6784\u5efa\u914d\u7f6e\u3002<\/td>\n\u5b83\u9700\u8981\u624b\u52a8\u8fdb\u884c\u6784\u5efa\u914d\u7f6e\u3002<\/td>\n<\/tr>\n
\u4e0d\u9700\u8981<\/strong>\u90e8\u7f72\u63cf\u8ff0\u7b26\u3002<\/td>\n \u5fc5\u9700<\/strong>\u3002<\/td>\n<\/tr>\n
\u5b83\u907f\u514d\u4e86\u6837\u677f\u4ee3\u7801\uff0c\u5e76\u5c06\u4f9d\u8d56\u9879\u5305\u88c5\u5728\u4e00\u4e2a\u5355\u5143\u4e2d\u3002<\/td>\n\u5b83\u5206\u522b\u6307\u5b9a\u6bcf\u4e2a\u4f9d\u8d56\u9879\u3002<\/td>\n<\/tr>\n
\u5b83\u51cf\u5c11<\/strong>\u5f00\u53d1\u65f6\u95f4\u5e76\u63d0\u9ad8\u751f\u4ea7\u7387\u3002<\/td>\n\u8981\u82b1\u8d39\u76f8\u540c\u7684\u65f6\u95f4\uff0c\u8981\u82b1\u8d39\u66f4\u591a<\/strong>\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\n

Spring Boot\u4f53\u7cfb\u7ed3\u6784<\/h2>\n
\n SpringBoot\u662fSpring\u6846\u67b6\u7684\u6a21\u5757\u3002\u5b83\u7528\u4e8e\u8f7b\u677e\u521b\u5efa\u72ec\u7acb\u7684\u751f\u4ea7\u7ea7\u57fa\u4e8eSpring\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u662f\u5728\u6838\u5fc3Spring\u6846\u67b6\u7684\u9876\u90e8\u5f00\u53d1\u7684\u3002\n<\/div>\n
\n SpringBoot\u9075\u5faa\u4e00\u4e2a\u5206\u5c42\u7684\u4f53\u7cfb\u7ed3\u6784\uff0c\u5176\u4e2d\u6bcf\u4e00\u5c42\u90fd\u4e0e\u5b83\u7684\u76f4\u63a5\u4e0b\u5c42\u6216\u4e0a\u5c42(\u5c42\u6b21\u7ed3\u6784)\u8fdb\u884c\u901a\u4fe1\u3002\n<\/div>\n
\n \u4e4b\u524d\u4e86\u89e3
\n SpringBoot Architecture <\/strong>\u540e\uff0c\u6211\u4eec\u5fc5\u987b\u4e86\u89e3\u5176\u4e2d\u7684\u4e0d\u540c\u5c42\u548c\u7c7b\u3002 SpringBoot\u4e2d\u6709
\n \u56db\u4e2a<\/strong>\u5c42\uff0c\u5982\u4e0b\u6240\u793a:\n<\/div>\n

\u5c55\u793a\u5c42<\/strong> <\/span>
\n \u4e1a\u52a1\u5c42<\/strong> <\/span>
\n \u6301\u4e45\u5c42<\/strong> <\/span>
\n \u6570\u636e\u5e93\u5c42<\/strong> <\/span>
\nSpringBoot \u4ecb\u7ecd_https:\/\/bianchenghao6.com_\u3010SpringBoot \u6559\u7a0b\u3011_\u7b2c1\u5f20 <\/p>\n

\n \u5c55\u793a\u5c42: <\/strong>\u8868\u793a\u5c42\u8d1f\u8d23\u5904\u7406HTTP\u8bf7\u6c42\uff0c\u5c06JSON\u53c2\u6570\u8f6c\u6362\u4e3a\u5bf9\u8c61\uff0c\u5e76\u5bf9\u8bf7\u6c42\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u5e76\u5c06\u5176\u4f20\u8f93\u5230\u4e1a\u52a1\u5c42\u3002\u7b80\u800c\u8a00\u4e4b\uff0c\u5b83\u7531
\n \u89c6\u56fe<\/strong>\u5373\u524d\u7aef\u90e8\u5206\u7ec4\u6210\u3002\n<\/div>\n
\n \u4e1a\u52a1\u5c42: <\/strong>\u4e1a\u52a1\u5c42\u5904\u7406\u6240\u6709
\n \u4e1a\u52a1\u903b\u8f91<\/strong> >\u3002\u5b83\u7531\u670d\u52a1\u7c7b\u7ec4\u6210\uff0c\u5e76\u4f7f\u7528\u6570\u636e\u8bbf\u95ee\u5c42\u63d0\u4f9b\u7684\u670d\u52a1\u3002\u5b83\u8fd8\u6267\u884c
\n \u6388\u6743<\/strong>\u548c
\n \u9a8c\u8bc1<\/strong>\u3002\n<\/div>\n
\n \u6301\u4e45\u5c42: <\/strong>\u6301\u4e45\u5c42\u5305\u542b\u6240\u6709
\n \u5b58\u50a8\u903b\u8f91<\/strong>\uff0c\u5e76\u5c06\u4e1a\u52a1\u5bf9\u8c61\u4e0e\u6570\u636e\u5e93\u884c\u8fdb\u884c\u76f8\u4e92\u8f6c\u6362\u3002\n<\/div>\n
\n \u6570\u636e\u5e93\u5c42: <\/strong>\u5728\u6570\u636e\u5e93\u5c42\u4e2d\uff0c
\n CRUD <\/strong>(\u521b\u5efa\uff0c\u68c0\u7d22\uff0c\u66f4\u65b0\uff0c\n<\/div>\n

Spring Boot Flow Architecture <\/h2>\n

SpringBoot \u4ecb\u7ecd_https:\/\/bianchenghao6.com_\u3010SpringBoot \u6559\u7a0b\u3011_\u7b2c2\u5f20
\n\u73b0\u5728\u6211\u4eec\u6709\u9a8c\u8bc1\u5668\u7c7b\uff0c\u89c6\u56fe\u7c7b\u548c\u5b9e\u7528\u7a0b\u5e8f\u7c7b\u3002 <\/span>
\n Spring Boot\u4f7f\u7528\u7c7b\u4f3c\u4e8eSpring MVC\uff0cSpring Data\u7b49\u7684\u6240\u6709\u6a21\u5757\u3002SpringBoot\u7684\u4f53\u7cfb\u7ed3\u6784\u4e0eSpring MVC\u7684\u4f53\u7cfb\u7ed3\u6784\u76f8\u540c\uff0c\u4e0d\u540c\u4e4b\u5904\u5728\u4e8e: \u4e0d\u9700\u8981 DAO <\/strong>\u548c DAOImpl <\/strong>\u7c7b\u5728Spring\u542f\u52a8\u4e2d\u3002<\/span>
\n\u521b\u5efa\u6570\u636e\u8bbf\u95ee\u5c42\u5e76\u6267\u884cCRUD\u64cd\u4f5c\u3002<\/span>
\n\u5ba2\u6237\u7aef\u53d1\u51faHTTP\u8bf7\u6c42(PUT\u6216GET)\u3002<\/span>
\n\u8bf7\u6c42\u53d1\u9001\u5230\u63a7\u5236\u5668\uff0c\u7136\u540e\u63a7\u5236\u5668\u6620\u5c04\u8be5\u8bf7\u6c42\u5e76\u8fdb\u884c\u5904\u7406\u3002\u4e4b\u540e\uff0c\u5982\u679c\u9700\u8981\uff0c\u5b83\u5c06\u8c03\u7528\u670d\u52a1\u903b\u8f91\u3002<\/span>
\n\u5728\u670d\u52a1\u5c42\u4e2d\uff0c\u6240\u6709\u4e1a\u52a1\u903b\u8f91\u90fd\u5c06\u6267\u884c\u3002\u5b83\u5bf9\u901a\u8fc7\u7c7b\u6620\u5c04\u5230JPA\u7684\u6570\u636e\u6267\u884c\u903b\u8f91\u3002<\/span>
\n\u5982\u679c\u6ca1\u6709\u53d1\u751f\u9519\u8bef\uff0c\u5219\u4f1a\u5c06JSP\u9875\u9762\u8fd4\u56de\u7ed9\u7528\u6237\u3002<\/span> <\/p>\n


\n","protected":false},"excerpt":{"rendered":"SpringBoot \u4ecb\u7ecdzh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[],"class_list":["post-577","post","type-post","status-publish","format-standard","hentry","category-bc_springboot_jc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/577"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=577"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/577\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}