{"id":3604,"date":"2023-11-02T17:20:02","date_gmt":"2023-11-02T09:20:02","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=3604"},"modified":"2023-11-02T17:20:02","modified_gmt":"2023-11-02T09:20:02","slug":"spring-boot%e8%b5%84%e6%ba%90%e5%8a%a0%e8%bd%bd%ef%bc%9a9%e7%a7%8d%e6%96%b9%e5%bc%8f%e8%bd%bb%e6%9d%be%e8%af%bb%e5%8f%96resources%e7%9b%ae%e5%bd%95%e4%b8%8b%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/spring-boot%e8%b5%84%e6%ba%90%e5%8a%a0%e8%bd%bd%ef%bc%9a9%e7%a7%8d%e6%96%b9%e5%bc%8f%e8%bd%bb%e6%9d%be%e8%af%bb%e5%8f%96resources%e7%9b%ae%e5%bd%95%e4%b8%8b%e6%96%87%e4%bb%b6\/","title":{"rendered":"Spring Boot\u8d44\u6e90\u52a0\u8f7d\uff1a9\u79cd\u65b9\u5f0f\u8f7b\u677e\u8bfb\u53d6resources\u76ee\u5f55\u4e0b\u6587\u4ef6"},"content":{"rendered":"<div class='wxsyncmain'>\n<blockquote style=\"padding: 15px 15px 15px 1rem;border-left-width: 6px;border-left-color: rgb(83, 109, 254);color: rgb(129, 145, 152);font-size: 0.9em;line-height: inherit;overflow-wrap: normal;width: 868.797px;background: rgb(242, 247, 251);overflow: auto;word-break: normal;border-radius: 9px;box-shadow: rgba(0, 0, 0, 0.14) 0px 2px 4px -1px, rgba(0, 0, 0, 0.12) 0px 4px 5px 0px, rgba(0, 0, 0, 0.4) 0px 1px 10px 0px;font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: normal;text-align: start;text-wrap: wrap;\">\n<p style=\"font-size: inherit;color: inherit;line-height: inherit;\"><span style=\"font-size: 16px;\">\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e5d\u6781\u5ba2<\/span><span style=\"font-size: 16px;\">\u6b22\u8fce\u661f\u6807\u5173\u6ce8\u4e5d\u6781\u5ba2\uff0c\u4e00\u8d77\u63a2\u8ba8\u6280\u672f\u4e0e\u67b6\u6784\uff01<\/span><\/p>\n<\/blockquote>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;\">\n<section class=\"mp_profile_iframe_wrp\" style=\"margin-bottom: 0px;outline: 0px;visibility: visible;\"><mp-common-profile class=\"js_uneditable custom_select_card mp_profile_iframe js_wx_tap_highlight\" data-pluginname=\"mpprofile\" data-id=\"MzI2NTE4MDkxNg==\" data-headimg=\"http:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/XWoHb49t3vsRb5IgdpE9qMXuokwu7DMleB5MxhEJlFldia1HibjPxp7qymdy9ImWuZfbibAa9po1jUdmnxrAr9aeQ\/0?wx_fmt=png\" data-nickname=\"\u4e5d\u6781\u5ba2\" data-alias=\"X-9xke\" data-signature=\"\u4e5d\u6781\u5ba2\uff0c\u6280\u672f\u6539\u53d8\u751f\u6d3b\uff0c\u6781\u5ba2\u6539\u53d8\u672a\u6765\uff01\u5173\u6ce8\u5e76\u5206\u4eab\u7f16\u7a0b\u8bed\u8a00\u3001Java\u6280\u672f\u3001\u6280\u672f\u67b6\u6784\u3001\u670d\u52a1\u5316\u3001\u5927\u6570\u636e\u3001\u4e91\u8ba1\u7b97\u3001\u673a\u5668\u5b66\u4e60\u3001\u81ea\u7136\u8bed\u8a00\u3001\u4eba\u5de5\u667a\u80fd\u3002\" data-from=\"2\" data-is_biz_ban=\"0\" data-origin_num=\"14\" data-isban=\"0\" data-biz_account_status=\"0\" data-index=\"0\"><\/mp-common-profile><\/section>\n<p style=\"margin-bottom: 0px;\"><br style=\"letter-spacing: 0.578px;text-wrap: wrap;\"  \/><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" data-ratio=\"0.562962962962963\" data-s=\"300,640\"  data-type=\"gif\" data-w=\"540\" style=\"\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171836185.gif\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" data-ratio=\"0.562962962962963\" data-s=\"300,640\"  data-type=\"gif\" data-w=\"540\" style=\"\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171836185.gif\"><\/noscript><\/p>\n<section style=\"font-size: 18px;color: rgb(62, 62, 62);line-height: 1;letter-spacing: 0px;font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;\">\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;text-indent: 2em;margin-bottom: 40px;\">\u5728Spring Boot\u9879\u76ee\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u8bfb\u53d6<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">resources<\/code>\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u4e0d\u8bba\u662f\u914d\u7f6e\u6587\u4ef6\u3001\u9759\u6001\u8d44\u6e90\u8fd8\u662f\u5176\u4ed6\u6570\u636e\u6587\u4ef6\u3002\u672c\u6587\u5c06\u4ecb\u7ecd9\u79cd\u4e0d\u540c\u7684\u65b9\u5f0f\uff0c\u5e2e\u52a9\u60a8\u8f7b\u677e\u8bfb\u53d6<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">resources<\/code>\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u3002<\/p>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f1: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">ClassPathResource<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.ClassPathResource;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.Resource;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.InputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">ResourceExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">static<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">main<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">(String[]args)<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{Resourceresource=<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>ClassPathResource(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"my-file.txt\"<\/span>);InputStreaminputStream=resource.getInputStream();<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8fdb\u4e00\u6b65\u5904\u7406inputStream<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f2: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">ResourceLoader<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.ResourceLoader;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.Resource;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.InputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.beans.factory.annotation.Autowired;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">ResourceLoaderExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(91, 218, 237);overflow-wrap: inherit !important;word-break: inherit !important;\">@Autowired<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">private<\/span>ResourceLoaderresourceLoader;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">readFile<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">()<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{Resourceresource=resourceLoader.getResource(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"classpath:my-file.txt\"<\/span>);InputStreaminputStream=resource.getInputStream();<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8fdb\u4e00\u6b65\u5904\u7406inputStream<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f3: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">ClassLoader<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.InputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">ClassLoaderExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">static<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">main<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">(String[]args)<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{ClassLoaderclassLoader=ClassLoaderExample.class.getClassLoader();InputStreaminputStream=classLoader.getResourceAsStream(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"my-file.txt\"<\/span>);<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8fdb\u4e00\u6b65\u5904\u7406inputStream<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f4: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">FileCopyUtils<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.util.FileCopyUtils;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.InputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.nio.charset.StandardCharsets;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">FileCopyUtilsExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">static<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">main<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">(String[]args)<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{InputStreaminputStream=FileCopyUtilsExample.class.getResourceAsStream(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"\/my-file.txt\"<\/span>);Stringcontent=<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>String(FileCopyUtils.copyToByteArray(inputStream),StandardCharsets.UTF_8);<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u5904\u7406content<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f5: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">ResourceUtils<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.util.ResourceUtils;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.File;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">ResourceUtilsExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">static<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">main<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">(String[]args)<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{Filefile=ResourceUtils.getFile(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"classpath:my-file.txt\"<\/span>);<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8fdb\u4e00\u6b65\u5904\u7406file<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f6: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">FileInputStream<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.File;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.FileInputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.IOException;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">FileInputStreamExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">static<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">main<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">(String[]args)<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{Filefile=<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>File(FileInputStreamExample.class.getClassLoader().getResource(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"my-file.txt\"<\/span>).getFile());<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">try<\/span>(FileInputStreamfis=<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>FileInputStream(file)){<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<\/span>}}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f7: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">SpringResourceLoader<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.context.annotation.Bean;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.DefaultResourceLoader;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.Resource;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.InputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">SpringResourceLoaderExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(91, 218, 237);overflow-wrap: inherit !important;word-break: inherit !important;\">@Bean<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span>DefaultResourceLoader<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">resourceLoader<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">()<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">return<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>DefaultResourceLoader();}<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">readFile<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">()<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{Resourceresource=resourceLoader().getResource(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"classpath:my-file.txt\"<\/span>);InputStreaminputStream=resource.getInputStream();<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8fdb\u4e00\u6b65\u5904\u7406inputStream<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f8: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">ServletContext<\/code><\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>javax.servlet.ServletContext;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.InputStream;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.beans.factory.annotation.Autowired;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">ServletContextExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(91, 218, 237);overflow-wrap: inherit !important;word-break: inherit !important;\">@Autowired<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">private<\/span>ServletContextservletContext;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">readFile<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">()<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{InputStreaminputStream=servletContext.getResourceAsStream(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"\/WEB-INF\/classes\/my-file.txt\"<\/span>);<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u8fdb\u4e00\u6b65\u5904\u7406inputStream<\/span>}}<\/p><\/pre>\n<p style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;\"><strong style=\"font-size: inherit;color: inherit;line-height: 1.5em;\">\u65b9\u5f0f9: \u4f7f\u7528<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">Paths<\/code>\u548c<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">Files<\/code>\uff08\u9002\u7528\u4e8eSpring Boot 2.x\u4ee5\u4e0a\uff09<\/strong><\/p>\n<pre style=\"font-size: inherit;color: inherit;line-height: 1.5em;\"><p style=\"margin-right: 2px;margin-left: 2px;line-height: 18px;font-size: 14px;letter-spacing: 0px;font-family: Consolas, Inconsolata, Courier, monospace;border-radius: 0px;color: rgb(169, 183, 198);background: rgb(40, 43, 46);padding: 0.5em;margin-bottom: 40px;overflow-wrap: normal !important;word-break: normal !important;overflow: auto !important;display: -webkit-box !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.Resource;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>org.springframework.core.io.DefaultResourceLoader;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.io.IOException;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.nio.file.Path;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.nio.file.Files;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">import<\/span>java.nio.charset.StandardCharsets;<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;color: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">class<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">PathsAndFilesExample<\/span><\/span>{<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\"><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">public<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">static<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">void<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(165, 218, 45);overflow-wrap: inherit !important;word-break: inherit !important;\">main<\/span><span style=\"font-size: inherit;line-height: 1.5em;color: rgb(255, 152, 35);overflow-wrap: inherit !important;word-break: inherit !important;\">(String[]args)<\/span><span style=\"font-size: inherit;line-height: 1.5em;overflow-wrap: inherit !important;word-break: inherit !important;\">throws<\/span>IOException<\/span>{DefaultResourceLoaderresourceLoader=<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>DefaultResourceLoader();Resourceresource=resourceLoader.getResource(<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(238, 220, 112);overflow-wrap: inherit !important;word-break: inherit !important;\">\"classpath:my-file.txt\"<\/span>);Pathpath=resource.getFile().toPath();Stringcontent=<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(248, 35, 117);overflow-wrap: inherit !important;word-break: inherit !important;\">new<\/span>String(Files.readAllBytes(path),StandardCharsets.UTF_8);<span style=\"font-size: inherit;line-height: 1.5em;color: rgb(128, 128, 128);overflow-wrap: inherit !important;word-break: inherit !important;\">\/\/\u5904\u7406content<\/span>}}<\/p><\/pre>\n<section style=\"font-size: inherit;color: inherit;line-height: 1.5em;margin-top: 0.5em;margin-bottom: 0.5em;text-indent: 2em;\">\u4ee5\u4e0a\u8fd99\u79cd\u65b9\u5f0f\u53ef\u4ee5\u8ba9\u60a8\u8f7b\u677e\u8bfb\u53d6<code style=\"font-size: inherit;line-height: 1.5em;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(233, 105, 0);background: rgb(248, 248, 248);\">resources<\/code>\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u9009\u62e9\u9002\u5408\u60a8\u9879\u76ee\u9700\u6c42\u7684\u65b9\u5f0f\uff0c\u5e76\u6839\u636e\u793a\u4f8b\u4ee3\u7801\u6765\u5b9e\u73b0\u6587\u4ef6\u8bfb\u53d6\u529f\u80fd\u3002\u5e0c\u671b\u8fd9\u4e9b\u65b9\u5f0f\u80fd\u5e2e\u52a9\u60a8\u5728Spring Boot\u9879\u76ee\u4e2d\u5904\u7406\u8d44\u6e90\u6587\u4ef6\u3002<span style=\"text-indent: 2em;color: rgba(0, 0, 0, 0.9);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: var(--articleFontsize);letter-spacing: 0.034em;\"><\/span><\/section>\n<\/section>\n<section data-tools=\"135\u7f16\u8f91\u5668\" data-id=\"116458\" style=\"margin-bottom: 0px;outline: 0px;\">\n<section style=\"margin: 20px auto;outline: 0px;\">\n<section style=\"outline: 0px;display: flex;align-items: center;\">\n<section data-width=\"50%\" style=\"outline: 0px;width: 316.047px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" x=\"0px\" y=\"0px\" viewbox=\"0 0 215 30\" style=\"enable-background:new 0 0 215 30;display:inline-block;\"><polygon style=\"fill:#b69a82;\" points=\"0,29.3 0.7,30 29,0.7 28.3,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"14.3,29.3 15,30 43.3,0.7 42.6,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"28.6,29.3 29.3,30 57.6,0.7 56.9,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"42.9,29.3 43.6,30 71.9,0.7 71.2,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"57.2,29.3 57.9,30 86.2,0.7 85.5,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"71.5,29.3 72.2,30 100.5,0.7 99.8,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"85.9,29.3 86.6,30 114.8,0.7 114.1,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"100.2,29.3 100.9,30 129.1,0.7 128.4,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"114.5,29.3 115.2,30 143.5,0.7 142.8,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"128.8,29.3 129.5,30 157.8,0.7 157.1,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"143.1,29.3 143.8,30 172.1,0.7 171.4,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"157.4,29.3 158.1,30 186.4,0.7 185.7,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"171.7,29.3 172.4,30 200.7,0.7 200,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"186,29.3 186.7,30 215,0.7 214.3,0 \"><\/polygon><\/svg><\/section>\n<section style=\"padding-right: 5px;padding-left: 5px;outline: 0px;font-size: 16px;color: rgb(80, 73, 67);text-align: center;flex-shrink: 0;\"><strong data-brushtype=\"text\" style=\"outline: 0px;\">END<\/strong><\/section>\n<section data-width=\"50%\" style=\"outline: 0px;width: 316.047px;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" x=\"0px\" y=\"0px\" viewbox=\"0 0 215 30\" style=\"enable-background:new 0 0 215 30;display:inline-block;\"><polygon style=\"fill:#b69a82;\" points=\"0,29.3 0.7,30 29,0.7 28.3,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"14.3,29.3 15,30 43.3,0.7 42.6,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"28.6,29.3 29.3,30 57.6,0.7 56.9,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"42.9,29.3 43.6,30 71.9,0.7 71.2,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"57.2,29.3 57.9,30 86.2,0.7 85.5,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"71.5,29.3 72.2,30 100.5,0.7 99.8,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"85.9,29.3 86.6,30 114.8,0.7 114.1,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"100.2,29.3 100.9,30 129.1,0.7 128.4,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"114.5,29.3 115.2,30 143.5,0.7 142.8,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"128.8,29.3 129.5,30 157.8,0.7 157.1,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"143.1,29.3 143.8,30 172.1,0.7 171.4,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"157.4,29.3 158.1,30 186.4,0.7 185.7,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"171.7,29.3 172.4,30 200.7,0.7 200,0 \"><\/polygon><polygon style=\"fill:#b69a82;\" points=\"186,29.3 186.7,30 215,0.7 214.3,0 \"><\/polygon><\/svg><\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px;outline: 0px;\"><span style=\"font-size: var(--articleFontsize);letter-spacing: 0.034em;text-indent: 0em;\"><\/span><\/p>\n<hr style=\"border-style: solid;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-color: rgba(0, 0, 0, 0.1);transform-origin: 0px 0px;transform: scale(1, 0.5);\"  \/>\n<p style=\"margin-bottom: 0px;text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-ratio=\"0.1859375\"  data-type=\"gif\" data-w=\"640\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171848642.gif\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-ratio=\"0.1859375\"  data-type=\"gif\" data-w=\"640\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171848642.gif\"  \/><\/noscript><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;line-height: 1.5em;text-align: center;\">\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;line-height: 1.75em;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzI2NTE4MDkxNg==&amp;mid=2247485112&amp;idx=1&amp;sn=6a7d6bbcb1416986bf782ef8e0055217&amp;chksm=eaa00523ddd78c35eb4adb5597a8d1d06031c002e3efc80f8708d59f53afb98af67d3e8101e6&amp;scene=21#wechat_redirect\" textvalue=\"SpringBoot\u83b7\u53d6Request\u7684\u4e09\u79cd\u65b9\u6cd5\uff0c\u4e00\u5b66\u5c31\u4f1a\uff01\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringBoot\u83b7\u53d6Request\u7684\u4e09\u79cd\u65b9\u6cd5\uff0c\u4e00\u5b66\u5c31\u4f1a\uff01<\/a><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;line-height: 1.75em;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzI2NTE4MDkxNg==&amp;mid=2247485061&amp;idx=2&amp;sn=c0165146e183c3abddbf342ff4c4032c&amp;chksm=eaa0051eddd78c081bb181853590ff6a7e10e36cd2709fef53f2e76dbda93c6fb795845fde9b&amp;scene=21#wechat_redirect\" textvalue=\"MySQL\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570\u8be6\u89e3\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >MySQL\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570\u8be6\u89e3<\/a><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;line-height: 1.75em;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzI2NTE4MDkxNg==&amp;mid=2247484957&amp;idx=1&amp;sn=c84664d190a028c00e597f0fe1e6704b&amp;chksm=eaa00586ddd78c906c39ad81ed93c3b89a4d04cbfef04728636b7e45242931a39ed3741b6e3f&amp;scene=21#wechat_redirect\" textvalue=\"\u591a\u8bed\u8a00\u56fd\u9645\u5316\u652f\u6301\u5728Spring Boot\u4e2d\u7684\u5b9e\u73b0\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >\u591a\u8bed\u8a00\u56fd\u9645\u5316\u652f\u6301\u5728Spring Boot\u4e2d\u7684\u5b9e\u73b0<\/a><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;line-height: 1.75em;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzI2NTE4MDkxNg==&amp;mid=2247484947&amp;idx=1&amp;sn=8d4d918652e1a4acd39ba4bf56b2e0a7&amp;chksm=eaa00588ddd78c9e72d5dea514d7b7cb6f27a3a262b88aac2ecede3a37ff7e700af81bddf86e&amp;scene=21#wechat_redirect\" textvalue=\"\u5982\u4f55\u5728Spring Boot\u9879\u76ee\u4e2d\u96c6\u6210Activiti\u5de5\u4f5c\u6d41\u5f15\u64ce\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >\u5982\u4f55\u5728Spring Boot\u9879\u76ee\u4e2d\u96c6\u6210Activiti\u5de5\u4f5c\u6d41\u5f15\u64ce<\/a><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;line-height: 1.75em;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzI2NTE4MDkxNg==&amp;mid=2247484777&amp;idx=1&amp;sn=a2047e8be448babe8d143364ab17b732&amp;chksm=eaa006f2ddd78fe487dae407d29ca1f8235506756c7b352722eadae384bdc6d74637de981c8b&amp;scene=21#wechat_redirect\" textvalue=\"Spring\u7ebf\u7a0b\u6c60ThreadPoolTaskExecutor\u7684\u9ad8\u6548\u5229\u7528\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >Spring\u7ebf\u7a0b\u6c60ThreadPoolTaskExecutor\u7684\u9ad8\u6548\u5229\u7528<\/a><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;line-height: 1.5em;text-align: center;\">\n<hr style=\"border-style: solid;border-right-width: 0px;border-bottom-width: 0px;border-left-width: 0px;border-color: rgba(0, 0, 0, 0.1);transform-origin: 0px 0px;transform: scale(1, 0.5);\"  \/>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;\">\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-backh=\"49\" data-backw=\"49\" data-cropselx1=\"0\" data-cropselx2=\"261\" data-cropsely1=\"0\" data-cropsely2=\"261\" data-ratio=\"1\"  data-w=\"258\" style=\"margin-right: auto;margin-left: auto;height: 261px;color: inherit;font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;letter-spacing: normal;text-align: start;text-wrap: wrap;border-width: 2px;border-style: solid;border-color: rgb(238, 238, 238);border-radius: 6px;line-height: inherit;display: block;box-shadow: rgba(0, 0, 0, 0.14) 0px 2px 4px -1px, rgba(0, 0, 0, 0.12) 0px 4px 5px 0px, rgba(0, 0, 0, 0.4) 0px 1px 10px 0px;width: 261px;\" title=\"\u56fe\u6ce8:\u5927\u5c11\u516c\u4f17\u53f7\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171852340.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-backh=\"49\" data-backw=\"49\" data-cropselx1=\"0\" data-cropselx2=\"261\" data-cropsely1=\"0\" data-cropsely2=\"261\" data-ratio=\"1\"  data-w=\"258\" style=\"margin-right: auto;margin-left: auto;height: 261px;color: inherit;font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: inherit;letter-spacing: normal;text-align: start;text-wrap: wrap;border-width: 2px;border-style: solid;border-color: rgb(238, 238, 238);border-radius: 6px;line-height: inherit;display: block;box-shadow: rgba(0, 0, 0, 0.14) 0px 2px 4px -1px, rgba(0, 0, 0, 0.12) 0px 4px 5px 0px, rgba(0, 0, 0, 0.4) 0px 1px 10px 0px;width: 261px;\" title=\"\u56fe\u6ce8:\u5927\u5c11\u516c\u4f17\u53f7\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171852340.jpeg\"  \/><\/noscript><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;text-align: center;\">\n<blockquote style=\"padding: 15px 15px 15px 1rem;border-left-width: 6px;border-left-color: rgb(83, 109, 254);color: rgb(129, 145, 152);font-size: 0.9em;line-height: inherit;overflow-wrap: normal;width: 868.797px;background: rgb(242, 247, 251);overflow: auto;word-break: normal;border-radius: 9px;box-shadow: rgba(0, 0, 0, 0.14) 0px 2px 4px -1px, rgba(0, 0, 0, 0.12) 0px 4px 5px 0px, rgba(0, 0, 0, 0.4) 0px 1px 10px 0px;font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: normal;text-align: start;text-wrap: wrap;\">\n<p style=\"outline: 0px;color: inherit;font-size: inherit;line-height: inherit;\">\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e5d\u6781\u5ba2\u6b22\u8fce\u661f\u6807\u5173\u6ce8\u4e5d\u6781\u5ba2\uff0c\u4e00\u8d77\u63a2\u8ba8\u6280\u672f\u4e0e\u67b6\u6784\uff01<\/p>\n<p style=\"outline: 0px;color: inherit;font-size: inherit;line-height: inherit;\"><span style=\"outline: 0px;\">\u5927\u5bb6\u7684\u70b9\u8d5e\u3001\u6536\u85cf\u548c\u8bc4\u8bba\u5f88\u91cd\u8981\uff0c<\/span><span style=\"outline: 0px;color: inherit;\">\u5982\u6587\u7ae0\u5bf9\u60a8\u6709\u5e2e\u52a9\u8fd8\u8bf7\u8f6c\u53d1\u652f\u6301\u4e0b\uff0c\u8c22\u8c22\uff01<\/span><\/p>\n<\/blockquote>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u4e5d\u6781\u5ba2              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e5d\u6781\u5ba2\u6b22\u8fce\u661f\u6807\u5173\u6ce8\u4e5d\u6781\u5ba2\uff0c\u4e00\u8d77\u63a2\u8ba8\u6280\u672f\u4e0e\u67b6\u6784\uff01 \u5728Spring Boot\u9879\u76ee\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u8bfb\u53d6resources\u76ee\u5f55\u4e0b\u7684 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-3604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171831674-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171836185.gif","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171831674-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171831674-1024x436.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171836185.gif","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171831674-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171831674-1024x436.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171831674.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171836185.gif","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171836185.gif","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171848642.gif","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171848642.gif","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171852340.jpeg","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102171852340.jpeg","id":"image5"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2023-11-02","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":577,"next_post_id":3590,"next_post_title":"RabbitMQ\u7684\u961f\u5217\u4e0e\u63d2\u4ef6","previous_post_id":3528,"previous_post_title":"SpringBoot \u63a5\u53e3\u7b7e\u540d\u6821\u9a8c\u5b9e\u8df5","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=3604"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3604\/revisions"}],"predecessor-version":[{"id":3614,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3604\/revisions\/3614"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/3600"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=3604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=3604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=3604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}