{"id":86587,"date":"2026-07-28T23:00:38","date_gmt":"2026-07-28T15:00:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86587.html"},"modified":"2026-07-28T23:00:38","modified_gmt":"2026-07-28T15:00:38","slug":"springboot-%e6%98%af%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87%e4%b8%80%e4%b8%aamain%e6%96%b9%e6%b3%95%e5%b0%b1%e6%8a%8a%e6%95%b4%e4%b8%aaweb%e7%8e%af%e5%a2%83%e5%8a%a0%e8%bd%bd%e8%b5%b7%e6%9d%a5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86587.html","title":{"rendered":"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765"},"content":{"rendered":"<p>\u8fd9\u4e2a\u89e6\u53ca\u4e86Java\u7684\u5e95\u5c42\u8fd0\u884c\u65f6\u673a\u5236\u3002<\/p>\n<p>\u8fd9\u4e2a\u201c\u7c7b\u52a0\u8f7d\u5668\u5965\u79d8\u201d\u3002<\/p>\n<p>Spring Boot\u5e76\u6ca1\u6709\u4f7f\u7528\u4efb\u4f55\u9ed1\u9b54\u6cd5&#xff0c;\u5b83\u5b8c\u5168\u9075\u5faaJava\u6807\u51c6\u7684\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b&#xff0c;\u4f46\u5de7\u5999\u5730\u5229\u7528\u4e86\u201cSPI\u673a\u5236\u201d\u548c\u201c\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668\u201d\u8fd9\u4e24\u4e2a\u5173\u952e\u70b9\u3002<\/p>\n<p>\u628a\u8fd9\u4e2a\u5965\u79d8\u62c6\u89e3\u4e3a\u4e09\u4e2a\u5173\u952e\u8c1c\u9898&#xff0c;\u770b\u5b8c\u4f1a\u8c41\u7136\u5f00\u6717\u3002<\/p>\n<hr \/>\n<h4>\u8c1c\u9898\u4e00&#xff1a;\u4e3a\u4ec0\u4e48\u4e00\u4e2a\u666e\u901a\u7684 main \u65b9\u6cd5\u80fd\u52a0\u8f7d\u6574\u4e2a Web \u73af\u5883&#xff1f;<\/h4>\n<p>\u5728Java\u4e2d&#xff0c;\u5f53\u4f60\u6267\u884cjava -jar myapp.jar\u65f6&#xff0c;JVM\u4f1a\u542f\u52a8\u4e00\u4e2aAppClassLoader&#xff08;\u7cfb\u7edf\u7c7b\u52a0\u8f7d\u5668&#xff09;&#xff0c;\u5b83\u8d1f\u8d23\u52a0\u8f7dclasspath\u4e0b\u7684\u6240\u6709\u7c7b\u3002<\/p>\n<p>\u5173\u952e\u70b9\u6765\u4e86&#xff1a;Spring Boot\u6253\u6210\u7684Fat Jar&#xff08;\u80d6\u5305&#xff09;\u91cc&#xff0c;BOOT-INF\/classes\u662f\u4f60\u7684\u4e1a\u52a1\u4ee3\u7801&#xff0c;BOOT-INF\/lib\u662f\u6240\u6709\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9Jar\u5305\u3002\u8fd9\u4e2a\u76ee\u5f55\u7ed3\u6784\u5e76\u4e0d\u662fJVM\u9ed8\u8ba4\u80fd\u8bc6\u522b\u7684\u666e\u901aclasspath\u3002<\/p>\n<p>Spring Boot\u7684\u89e3\u6cd5&#xff1a;\u5b83\u6ca1\u6709\u4fee\u6539JVM\u7684\u7c7b\u52a0\u8f7d\u5668&#xff0c;\u800c\u662f\u81ea\u5b9a\u4e49\u4e86\u4e00\u4e2aLaunchedURLClassLoader\u3002<\/p>\n<ul>\n<li>\n<p>\u5728MANIFEST.MF\u4e2d\u6307\u5b9a\u4e86Main-Class: org.springframework.boot.loader.JarLauncher\u3002<\/p>\n<\/li>\n<li>\n<p>\u5f53JVM\u542f\u52a8\u65f6&#xff0c;\u5148\u542f\u52a8JarLauncher&#xff0c;\u5b83\u521b\u5efa\u4e86\u4e00\u4e2aLaunchedURLClassLoader\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u7c7b\u52a0\u8f7d\u5668\u77e5\u9053\u5982\u4f55\u8bfb\u53d6BOOT-INF\/classes\u548cBOOT-INF\/lib\u4e0b\u7684\u5d4c\u5957Jar\u5305&#xff0c;\u5e76\u5c06\u5b83\u4eec\u7eb3\u5165\u81ea\u5df1\u7684\u52a0\u8f7d\u8303\u56f4\u3002<\/p>\n<\/li>\n<li>\n<p>\u968f\u540e&#xff0c;\u8fd9\u4e2a\u7c7b\u52a0\u8f7d\u5668\u53bb\u52a0\u8f7d\u4f60\u7684&#064;SpringBootApplication\u4e3b\u7c7b&#xff0c;\u5e76\u8c03\u7528\u5176main\u65b9\u6cd5\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a;\u4e0d\u662fmain\u65b9\u6cd5\u795e\u901a\u5e7f\u5927&#xff0c;\u800c\u662f\u542f\u52a8\u5668&#xff08;Launcher&#xff09;\u5148\u521b\u5efa\u4e86\u4e00\u4e2a\u201c\u8bc6\u8d27\u201d\u7684\u7c7b\u52a0\u8f7d\u5668&#xff0c;\u518d\u7531\u5b83\u53bb\u6267\u884c\u4f60\u7684main\u65b9\u6cd5\u3002<\/p>\n<hr \/>\n<h4>\u8c1c\u9898\u4e8c&#xff1a;\u6253\u7834\u53cc\u4eb2\u59d4\u6d3e\u7684\u201c\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668\u201d&#xff08;\u6838\u5fc3&#xff01;&#xff09;<\/h4>\n<p>\u8fd9\u662f\u6574\u4e2a\u6d41\u7a0b\u4e2d\u6700\u7cbe\u5999\u7684\u5730\u65b9\u3002\u6211\u4eec\u77e5\u9053&#xff0c;Spring\u6846\u67b6\u672c\u8eab\u662f\u4e00\u4e2a\u7b2c\u4e09\u65b9\u5e93&#xff0c;\u5b83\u662f\u7531AppClassLoader\u52a0\u8f7d\u7684\u3002<\/p>\n<p>\u4f46\u95ee\u9898\u6765\u4e86&#xff1a;\u5f53Spring\u5bb9\u5668\u5728\u521d\u59cb\u5316\u65f6&#xff0c;\u9700\u8981\u52a8\u6001\u52a0\u8f7d\u4f60\u7684\u4e1a\u52a1\u7c7b&#xff08;\u6bd4\u5982&#064;Service\u3001&#064;Controller&#xff09;&#xff0c;\u800c\u6b64\u65f6Spring\u7684\u4ee3\u7801\u5c5e\u4e8eAppClassLoader&#xff0c;\u4f60\u7684\u4e1a\u52a1\u7c7b\u4e5f\u5728AppClassLoader\u91cc&#xff0c;\u597d\u50cf\u6ca1\u6bdb\u75c5&#xff1f;<\/p>\n<p>\u9ebb\u70e6\u51fa\u5728\u201cSPI&#xff08;\u670d\u52a1\u63d0\u4f9b\u8005\u63a5\u53e3&#xff09;\u201d\u4e0a\u3002<\/p>\n<p>\u6bd4\u5982JNDI\u3001JDBC\u3001XML\u89e3\u6790\u7b49Java\u6807\u51c6\u5e93&#xff08;\u7531BootstrapClassLoader\u52a0\u8f7d&#xff09;\u4e2d\u7684\u63a5\u53e3&#xff0c;\u9700\u8981\u8c03\u7528\u7b2c\u4e09\u65b9\u5b9e\u73b0&#xff08;\u6bd4\u5982MySQL\u9a71\u52a8&#xff0c;\u7531AppClassLoader\u52a0\u8f7d&#xff09;\u3002\u6309\u7167\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b&#xff0c;\u7236\u7c7b\u52a0\u8f7d\u5668&#xff08;Bootstrap&#xff09;\u65e0\u6cd5\u53cd\u5411\u59d4\u6d3e\u7ed9\u5b50\u7c7b\u52a0\u8f7d\u5668&#xff08;App&#xff09;\u53bb\u52a0\u8f7d\u7c7b&#xff0c;\u8fd9\u4f1a\u5bfc\u81f4ClassNotFoundException\u3002<\/p>\n<p>Spring Boot\u7684\u89e3\u6cd5&#xff08;\u4e5f\u662fJava\u7684\u5b98\u65b9\u6551\u573a\u65b9\u6848&#xff09;&#xff1a;<br \/>\n\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668&#xff08;Thread Context ClassLoader&#xff0c;\u7b80\u79f0TCCL&#xff09;\u3002<\/p>\n<ul>\n<li>\n<p>\u5728JarLauncher\u542f\u52a8\u65f6&#xff0c;\u4f1a\u6267\u884cThread.currentThread().setContextClassLoader(\u81ea\u5b9a\u4e49\u7c7b\u52a0\u8f7d\u5668)\u3002<\/p>\n<\/li>\n<li>\n<p>\u6574\u4e2aSpring\u5bb9\u5668\u7684\u5237\u65b0&#xff08;refresh&#xff09;\u8fc7\u7a0b&#xff0c;\u90fd\u8fd0\u884c\u5728\u8fd9\u4e2a\u7ebf\u7a0b\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>\u5f53Java\u6807\u51c6\u5e93\u4e2d\u7684SPI\u4ee3\u7801\u9700\u8981\u52a0\u8f7d\u5b9e\u73b0\u7c7b\u65f6&#xff0c;\u4f1a\u8c03\u7528Thread.currentThread().getContextClassLoader().loadClass()&#xff0c;\u4ece\u800c\u6210\u529f\u62ff\u5230\u7531LaunchedURLClassLoader\u52a0\u8f7d\u7684MySQL\u9a71\u52a8\u6216\u4f60\u7684\u4e1a\u52a1\u7c7b\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u5c31\u662f\u771f\u76f8&#xff1a;\u7c7b\u52a0\u8f7d\u7684\u201c\u7236\u59d4\u6258\u201d\u6a21\u578b\u5728\u8fd9\u91cc\u88ab\u6253\u7834\u4e86&#xff0c;\u7236\u7c7b\u52a0\u8f7d\u5668\u901a\u8fc7TCCL\u8fd9\u4e2a\u201c\u540e\u95e8\u201d\u53cd\u5411\u83b7\u53d6\u4e86\u5b50\u7c7b\u52a0\u8f7d\u5668\u7684\u80fd\u529b\u3002<\/p>\n<hr \/>\n<h4>\u8c1c\u9898\u4e09&#xff1a;\u4e3a\u4ec0\u4e48Tomcat\u8fd8\u8981\u81ea\u5df1\u518d\u641e\u4e00\u5957\u7c7b\u52a0\u8f7d\u5668&#xff1f;<\/h4>\n<p>\u5f53\u4f60\u542f\u52a8\u5185\u5d4cTomcat\u65f6&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u597d\u5947&#xff1a;Tomcat\u5df2\u7ecf\u7531AppClassLoader\u52a0\u8f7d\u4e86&#xff0c;\u4e3a\u4ec0\u4e48\u5b83\u8fd8\u8981\u5728\u81ea\u5df1\u7684WebApp\u4e2d\u518d\u521b\u5efa\u72ec\u7acb\u7684WebappClassLoader&#xff1f;<\/p>\n<p>\u539f\u56e0\u6709\u4e8c&#xff0c;\u8fd9\u4e5f\u662f\u9632\u6b62\u201c\u7c7b\u51b2\u7a81\u201d\u7684\u9632\u706b\u5899&#xff1a;<\/p>\n<li>\n<p>\u9694\u79bb\u591a\u4e2a\u5e94\u7528&#xff1a;\u867d\u7136\u6211\u4eec\u901a\u5e38\u53ea\u90e8\u7f72\u4e00\u4e2a\u5e94\u7528&#xff0c;\u4f46Tomcat\u7684\u8bbe\u8ba1\u521d\u8877\u662f\u652f\u6301\u591a\u5e94\u7528\u3002WebappClassLoader\u786e\u4fdd\u4e0d\u540c\u5e94\u7528\u4e4b\u95f4\u7684\u7c7b&#xff08;\u5373\u4f7f\u5305\u540d\u5b8c\u5168\u76f8\u540c&#xff09;\u4e5f\u4e0d\u4f1a\u4e92\u76f8\u5e72\u6270\u3002<\/p>\n<\/li>\n<li>\n<p>\u652f\u6301\u70ed\u90e8\u7f72&#xff1a;\u5f53\u4f60\u4fee\u6539\u4ee3\u7801\u91cd\u542f\u5e94\u7528\u65f6&#xff08;DevTools&#xff09;&#xff0c;Tomcat\u4f1a\u4e22\u5f03\u65e7\u7684WebappClassLoader&#xff0c;\u65b0\u5efa\u4e00\u4e2a\u65b0\u7684&#xff0c;\u4ece\u800c\u5378\u8f7d\u6240\u6709\u65e7\u7c7b&#xff0c;\u907f\u514d\u6c38\u4e45\u4ee3\/\u5143\u7a7a\u95f4\u5185\u5b58\u6ea2\u51fa\u3002<\/p>\n<\/li>\n<p>\u6d41\u7a0b\u4e32\u8054&#xff1a;<br \/>\nLaunchedURLClassLoader&#xff08;\u52a0\u8f7d\u6240\u6709Jar&#xff09; -&gt; \u542f\u52a8main\u00a0-&gt; \u521b\u5efaTomcat\u00a0-&gt; Tomcat\u5185\u90e8\u521b\u5efaWebappClassLoader&#xff08;\u4f5c\u4e3aLaunchedURLClassLoader\u7684\u5b50\u52a0\u8f7d\u5668&#xff09; -&gt;\u00a0WebappClassLoader\u52a0\u8f7d\u4f60\u7684DispatcherServlet\u548c&#064;Controller\u3002<\/p>\n<hr \/>\n<h4>\u5b8c\u6574\u7c7b\u52a0\u8f7d\u5668\u5c42\u7ea7\u5173\u7cfb\u56fe<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"826\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728150037-6a68c4153e752.png\" width=\"718\" \/><\/p>\n<hr \/>\n<h4>\u9762\u8bd5\u5b98\u6700\u60f3\u542c\u7684\u201c\u4e00\u53e5\u8bdd\u603b\u7ed3\u201d<\/h4>\n<p>Spring Boot\u542f\u52a8\u7684\u5965\u79d8\u5728\u4e8e&#xff1a;\u5229\u7528\u81ea\u5b9a\u4e49LaunchedURLClassLoader\u89e3\u51b3\u4e86\u5d4c\u5957Jar\u7684\u8bfb\u53d6\u95ee\u9898&#xff1b;\u5229\u7528\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668&#xff08;TCCL&#xff09;\u6253\u7834\u4e86\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b\u7684\u65b9\u5411\u6027\u9650\u5236&#xff0c;\u8ba9\u7236\u7c7b\u52a0\u8f7d\u5668\u80fd\u53cd\u5411\u83b7\u53d6\u5b50\u7c7b\u52a0\u8f7d\u5668\u4e2d\u7684SPI\u5b9e\u73b0&#xff1b;\u6700\u540e&#xff0c;\u5185\u5d4cTomcat\u518d\u521b\u5efa\u72ec\u7acb\u7684WebappClassLoader&#xff0c;\u5b9e\u73b0\u5e94\u7528\u95f4\u7684\u7c7b\u9694\u79bb\u3002<\/p>\n<hr \/>\n<p>\u5982\u679c\u4f60\u5bf9\u8fd9\u4e2a\u673a\u5236\u610f\u72b9\u672a\u5c3d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u7ee7\u7eed\u5f80\u4e0b\u6316\u4e24\u4e2a\u65b9\u5411&#xff1a;<\/p>\n<li>\n<p>\u65e2\u7136TCCL\u6253\u7834\u4e86\u53cc\u4eb2\u59d4\u6d3e&#xff0c;\u90a3\u4e3a\u4ec0\u4e48Tomcat\u7684WebappClassLoader\u9ed8\u8ba4\u8fd8\u8981\u9075\u5faa\u201c\u5148\u627e\u5b50\u7c7b\u52a0\u8f7d\u5668&#xff0c;\u518d\u627e\u7236\u7c7b\u201d\u7684\u53cd\u5411\u59d4\u6258&#xff1f;&#xff08;\u8fd9\u662fTomcat\u7279\u6709\u7684\u4f18\u5316&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u6211\u81ea\u5df1\u5199\u4e00\u4e2a\u7c7b&#xff0c;\u5305\u540d\u548cJDK\u7684\u4e00\u6837&#xff08;\u6bd4\u5982java.lang&#xff09;&#xff0c;Spring Boot\u80fd\u52a0\u8f7d\u6210\u529f\u5417&#xff1f;\u4e3a\u4ec0\u4e48\u4f1a\u62a5\u9519&#xff1f;&#xff08;\u5b89\u5168\u673a\u5236\u7684\u5e95\u5c42\u5b9e\u73b0&#xff09;<\/p>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e2a\u89e6\u53ca\u4e86Java\u7684\u5e95\u5c42\u8fd0\u884c\u65f6\u673a\u5236\u3002\u8fd9\u4e2a\u201c\u7c7b\u52a0\u8f7d\u5668\u5965\u79d8\u201d\u3002Spring Boot\u5e76\u6ca1\u6709\u4f7f\u7528\u4efb\u4f55\u9ed1\u9b54\u6cd5&#xff0c;\u5b83\u5b8c\u5168\u9075\u5faaJava\u6807\u51c6\u7684\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b&#xff0c;\u4f46\u5de7\u5999\u5730\u5229\u7528\u4e86\u201cSPI\u673a\u5236\u201d\u548c\u201c\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668\u201d\u8fd9\u4e24\u4e2a\u5173\u952e\u70b9\u3002\u628a\u8fd9\u4e2a\u5965\u79d8\u62c6\u89e3\u4e3a\u4e09\u4e2a\u5173\u952e\u8c1c\u9898&#xff0c;\u770b\u5b8c\u4f1a\u8c41\u7136\u5f00\u6717\u3002\u8c1c\u9898\u4e00&#xff1a;\u4e3a\u4ec0\u4e48\u4e00\u4e2a\u666e\u901a\u7684 main \u65b9\u6cd5\u80fd\u52a0\u8f7d\u6574\u4e2a Web \u73af\u5883&#xff1f;\u5728Java\u4e2d&#xff0c;\u5f53\u4f60\u6267\u884cjava -jar myapp.jar\u65f6&#xff0c;<\/p>\n","protected":false},"author":2,"featured_media":86586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[98,87,292],"topic":[],"class_list":["post-86587","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-spring-boot","tag-87","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765 - \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\/86587.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u8fd9\u4e2a\u89e6\u53ca\u4e86Java\u7684\u5e95\u5c42\u8fd0\u884c\u65f6\u673a\u5236\u3002\u8fd9\u4e2a\u201c\u7c7b\u52a0\u8f7d\u5668\u5965\u79d8\u201d\u3002Spring Boot\u5e76\u6ca1\u6709\u4f7f\u7528\u4efb\u4f55\u9ed1\u9b54\u6cd5&#xff0c;\u5b83\u5b8c\u5168\u9075\u5faaJava\u6807\u51c6\u7684\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b&#xff0c;\u4f46\u5de7\u5999\u5730\u5229\u7528\u4e86\u201cSPI\u673a\u5236\u201d\u548c\u201c\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668\u201d\u8fd9\u4e24\u4e2a\u5173\u952e\u70b9\u3002\u628a\u8fd9\u4e2a\u5965\u79d8\u62c6\u89e3\u4e3a\u4e09\u4e2a\u5173\u952e\u8c1c\u9898&#xff0c;\u770b\u5b8c\u4f1a\u8c41\u7136\u5f00\u6717\u3002\u8c1c\u9898\u4e00&#xff1a;\u4e3a\u4ec0\u4e48\u4e00\u4e2a\u666e\u901a\u7684 main \u65b9\u6cd5\u80fd\u52a0\u8f7d\u6574\u4e2a Web \u73af\u5883&#xff1f;\u5728Java\u4e2d&#xff0c;\u5f53\u4f60\u6267\u884cjava -jar myapp.jar\u65f6&#xff0c;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86587.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-28T15:00:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728150037-6a68c4153e752.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86587.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86587.html\",\"name\":\"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-28T15:00:38+00:00\",\"dateModified\":\"2026-07-28T15:00:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86587.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86587.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86587.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765\"}]},{\"@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":"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765 - \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\/86587.html","og_locale":"zh_CN","og_type":"article","og_title":"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u8fd9\u4e2a\u89e6\u53ca\u4e86Java\u7684\u5e95\u5c42\u8fd0\u884c\u65f6\u673a\u5236\u3002\u8fd9\u4e2a\u201c\u7c7b\u52a0\u8f7d\u5668\u5965\u79d8\u201d\u3002Spring Boot\u5e76\u6ca1\u6709\u4f7f\u7528\u4efb\u4f55\u9ed1\u9b54\u6cd5&#xff0c;\u5b83\u5b8c\u5168\u9075\u5faaJava\u6807\u51c6\u7684\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b&#xff0c;\u4f46\u5de7\u5999\u5730\u5229\u7528\u4e86\u201cSPI\u673a\u5236\u201d\u548c\u201c\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668\u201d\u8fd9\u4e24\u4e2a\u5173\u952e\u70b9\u3002\u628a\u8fd9\u4e2a\u5965\u79d8\u62c6\u89e3\u4e3a\u4e09\u4e2a\u5173\u952e\u8c1c\u9898&#xff0c;\u770b\u5b8c\u4f1a\u8c41\u7136\u5f00\u6717\u3002\u8c1c\u9898\u4e00&#xff1a;\u4e3a\u4ec0\u4e48\u4e00\u4e2a\u666e\u901a\u7684 main \u65b9\u6cd5\u80fd\u52a0\u8f7d\u6574\u4e2a Web \u73af\u5883&#xff1f;\u5728Java\u4e2d&#xff0c;\u5f53\u4f60\u6267\u884cjava -jar myapp.jar\u65f6&#xff0c;","og_url":"https:\/\/www.wsisp.com\/helps\/86587.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-28T15:00:38+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260728150037-6a68c4153e752.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86587.html","url":"https:\/\/www.wsisp.com\/helps\/86587.html","name":"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-28T15:00:38+00:00","dateModified":"2026-07-28T15:00:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86587.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86587.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86587.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"SpringBoot \u662f\u5982\u4f55\u901a\u8fc7\u4e00\u4e2amain\u65b9\u6cd5\u5c31\u628a\u6574\u4e2aWeb\u73af\u5883\u52a0\u8f7d\u8d77\u6765"}]},{"@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\/86587","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=86587"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86587\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/86586"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86587"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}