{"id":2232,"date":"2024-11-10T16:43:25","date_gmt":"2024-11-10T08:43:25","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2232\/"},"modified":"2024-11-10T16:43:25","modified_gmt":"2024-11-10T08:43:25","slug":"xml%e6%96%87%e4%bb%b6%e6%a0%87%e7%ba%a2%e6%8a%a5%e9%94%99%ef%bc%8c%e8%af%a5%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2232\/","title":{"rendered":"XML\u6587\u4ef6\u6807\u7ea2\u62a5\u9519\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173069570691245.jpg\" class=\"aligncenter\" title=\"XML\u6587\u4ef6\u6807\u7ea2\u62a5\u9519\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"XML\u6587\u4ef6\u6807\u7ea2\u62a5\u9519\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>xml\u6587\u4ef6\u4e3a\u4f55\u6807\u7ea2\u62a5\u9519\uff1f<\/strong><\/p>\n<p>\u60a8\u63d0\u4f9b\u7684xml\u6587\u4ef6\u4e2d<\/p>\n<\/p>\n<pre>&lt;code class=\"text\"&gt;\u6807\u7b7e\u672a\u5173\u95ed\u3002\u8bf7\u786e\u4fdd\u6240\u6709\u6807\u7b7e\u90fd\u6b63\u786e\u5173\u95ed\u3002&lt;\/p&gt;&lt;p&gt;&lt;strong&gt;\u8fd0\u884c\u6b63\u5e38\u4f46\u767b\u5f55\u540e\u53f0\u62a5\u9519\uff1f&lt;\/strong&gt;&lt;\/p&gt;&lt;p&gt;\u4ece\u63d0\u4f9b\u7684\u65e5\u5fd7\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u5f02\u5e38\u53d1\u751f\u5728UserController.login()\u65b9\u6cd5\u4e2d\u3002\u5176\u4e2d\u63d0\u5230\u201cjava.lang.NullPointerException\u201d\uff0c\u8fd9\u901a\u5e38\u8868\u793a\u5c1d\u8bd5\u8bbf\u95ee\u4e86\u7a7a\u5bf9\u8c61\u3002&lt;\/p&gt;&lt;p&gt;&lt;strong&gt;\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848\uff1a&lt;\/strong&gt;&lt;\/p&gt;&lt;p&gt;\u53ef\u80fd\u662fmapper\u63a5\u53e3\u6ca1\u6709\u88abSpring\u626b\u63cf\u5230\u3002\u60a8\u9700\u8981\u5728\u542f\u52a8\u7c7b\u6216\u914d\u7f6e\u7c7b\u4e0a\u6dfb\u52a0@MapperScan\u6ce8\u89e3\uff0c\u6307\u5b9amapper\u63a5\u53e3\u6240\u5728\u5305\u8def\u5f84\uff0c\u4f8b\u5982\uff1a&lt;\/p&gt;&lt;pre class=\"brush:php;toolbar:false\"&gt;@SpringBootApplication\n@MapperScan(\"com.xxx.xxx.mapper\")\npublic class Application {\n    ...\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fXML\u6587\u4ef6\u6807\u7ea2\u62a5\u9519\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>xml\u6587\u4ef6\u4e3a\u4f55\u6807\u7ea2\u62a5\u9519\uff1f \u60a8\u63d0\u4f9b\u7684xml\u6587\u4ef6\u4e2d &lt;code class=&#8221;text&#8221;&gt;\u6807\u7b7e\u672a\u5173\u95ed\u3002\u8bf7\u786e\u4fdd\u6240\u6709\u6807\u7b7e\u90fd\u6b63\u786e\u5173\u95ed\u3002&lt;\/p&gt;&lt;p&gt;&lt;strong&gt;\u8fd0\u884c\u6b63\u5e38\u4f46\u767b\u5f55\u540e\u53f0\u62a5\u9519\uff1f&lt;\/strong&gt;&lt;\/p&gt;&lt;p&gt;\u4ece\u63d0\u4f9b\u7684\u65e5\u5fd7\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u5f02\u5e38\u53d1\u751f\u5728UserController.login()\u65b9\u6cd5\u4e2d\u3002\u5176\u4e2d\u63d0\u5230\u201cjava.lang.NullPointerException\u201d\uff0c\u8fd9\u901a\u5e38\u8868\u793a\u5c1d\u8bd5\u8bbf\u95ee\u4e86\u7a7a\u5bf9\u8c61\u3002&lt;\/p&gt;&lt;p&gt;&lt;strong&gt;\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848\uff1a&lt;\/strong&gt;&lt;\/p&gt;&lt;p&gt;\u53ef\u80fd\u662fmapper\u63a5\u53e3\u6ca1\u6709\u88abSpring\u626b\u63cf\u5230\u3002\u60a8\u9700\u8981\u5728\u542f\u52a8\u7c7b\u6216\u914d\u7f6e\u7c7b\u4e0a\u6dfb\u52a0@MapperScan\u6ce8\u89e3\uff0c\u6307\u5b9amapper\u63a5\u53e3\u6240\u5728\u5305\u8def\u5f84\uff0c\u4f8b\u5982\uff1a&lt;\/p&gt;&lt;pre class=&#8221;brush:php;toolbar:false&#8221;&gt;@SpringBootApplication @MapperScan(&#8220;com.xxx.xxx.mapper&#8221;) public class Application { &#8230; } \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662fXML\u6587\u4ef6\u6807\u7ea2\u62a5\u9519\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2232","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=2232"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2232\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}