{"id":120632,"date":"2026-10-31T23:47:42","date_gmt":"2026-10-31T15:47:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/120632.html"},"modified":"2026-10-31T23:47:42","modified_gmt":"2026-10-31T15:47:42","slug":"java-ee-%e8%bf%9b%e9%98%b6%ef%bc%9a4-spring-web-mvc-%e5%85%a5%e9%97%a8%ef%bc%88%e7%ac%ac%e5%9b%9b%e5%bc%b9%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/120632.html","title":{"rendered":"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"3.%E7%BB%BC%E5%90%88%E6%80%A7%E7%BB%83%E4%B9%A0-toc\" style=\"margin-left:0px\">3.\u7efc\u5408\u6027\u7ec3\u4e60<\/p>\n<p id=\"3.1%20%E5%8A%A0%E6%B3%95%E8%AE%A1%E7%AE%97%E5%99%A8-toc\" style=\"margin-left:40px\">3.1 \u52a0\u6cd5\u8ba1\u7b97\u5668<\/p>\n<p id=\"3.1.1%20%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C-toc\" style=\"margin-left:80px\">3.1.1 \u51c6\u5907\u5de5\u4f5c<\/p>\n<p id=\"3.1.2%20%E7%BA%A6%E5%AE%9A%E5%89%8D%E5%90%8E%E7%AB%AF%E4%BA%A4%E4%BA%92%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:80px\">3.1.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3<\/p>\n<p id=\"%E6%A6%82%E5%BF%B5%E4%BB%8B%E7%BB%8D-toc\" style=\"margin-left:120px\">\u6982\u5ff5\u4ecb\u7ecd<\/p>\n<p id=\"%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90-toc\" style=\"margin-left:120px\">\u9700\u6c42\u5206\u6790<\/p>\n<p id=\"%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89-toc\" style=\"margin-left:120px\">\u63a5\u53e3\u5b9a\u4e49<\/p>\n<p id=\"%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0-toc\" style=\"margin-left:120px\">\u8bf7\u6c42\u53c2\u6570<\/p>\n<p id=\"%E5%93%8D%E5%BA%94%E6%95%B0%E6%8D%AE-toc\" style=\"margin-left:120px\">\u54cd\u5e94\u6570\u636e<\/p>\n<p id=\"3.1.3%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:80px\">3.1.3 \u670d\u52a1\u5668\u4ee3\u7801<\/p>\n<p id=\"3.1.4%20%E8%B0%83%E6%95%B4%E5%89%8D%E7%AB%AF%E9%A1%B5%E9%9D%A2%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:80px\">3.1.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801<\/p>\n<p id=\"3.1.5%20%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95-toc\" style=\"margin-left:80px\">3.1.5 \u8fd0\u884c\u6d4b\u8bd5<\/p>\n<p id=\"3.2%20%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95-toc\" style=\"margin-left:40px\">3.2 \u7528\u6237\u767b\u5f55<\/p>\n<p id=\"3.2.1%20%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C-toc\" style=\"margin-left:80px\">3.2.1 \u51c6\u5907\u5de5\u4f5c<\/p>\n<p id=\"3.2.2%20%E7%BA%A6%E5%AE%9A%E5%89%8D%E5%90%8E%E7%AB%AF%E4%BA%A4%E4%BA%92%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:80px\">3.2.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3<\/p>\n<p id=\"%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90-toc\" style=\"margin-left:120px\">\u9700\u6c42\u5206\u6790<\/p>\n<p id=\"%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89-toc\" style=\"margin-left:120px\">\u63a5\u53e3\u5b9a\u4e49<\/p>\n<p id=\"%E6%A0%A1%E9%AA%8C%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:160px\">\u6821\u9a8c\u63a5\u53e3<\/p>\n<p id=\"%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0-toc\" style=\"margin-left:200px\">\u8bf7\u6c42\u53c2\u6570<\/p>\n<p id=\"%E5%93%8D%E5%BA%94%E6%95%B0%E6%8D%AE-toc\" style=\"margin-left:200px\">\u54cd\u5e94\u6570\u636e<\/p>\n<p id=\"%E6%9F%A5%E8%AF%A2%E7%99%BB%E5%BD%95%E7%94%A8%E6%88%B7%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:160px\">\u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3<\/p>\n<p id=\"%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0-toc\" style=\"margin-left:200px\">\u8bf7\u6c42\u53c2\u6570<\/p>\n<p id=\"%E5%93%8D%E5%BA%94%E6%95%B0%E6%8D%AE-toc\" style=\"margin-left:200px\">\u54cd\u5e94\u6570\u636e<\/p>\n<p id=\"3.2.3%20%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:80px\">3.2.3 \u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u4ee3\u7801<\/p>\n<p id=\"%E6%A0%A1%E9%AA%8C%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:120px\">\u6821\u9a8c\u63a5\u53e3<\/p>\n<p id=\"%E6%9F%A5%E8%AF%A2%E7%99%BB%E5%BD%95%E7%94%A8%E6%88%B7%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:120px\">\u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3<\/p>\n<p id=\"3.2.4%20%E8%B0%83%E6%95%B4%E5%89%8D%E7%AB%AF%E9%A1%B5%E9%9D%A2%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:80px\">3.2.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801<\/p>\n<p id=\"1.%E8%B0%83%E6%95%B4%E7%99%BB%E5%BD%95%E9%A1%B5%E9%9D%A2%20login.html-toc\" style=\"margin-left:120px\">1.\u8c03\u6574\u767b\u5f55\u9875\u9762 login.html<\/p>\n<p id=\"2.%E8%B0%83%E6%95%B4%E9%A6%96%E9%A1%B5%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:120px\">2.\u8c03\u6574\u9996\u9875\u4ee3\u7801<\/p>\n<p id=\"3.2.5%20%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95-toc\" style=\"margin-left:80px\">3.2.5 \u8fd0\u884c\u6d4b\u8bd5<\/p>\n<hr id=\"hr-toc\" \/>\n<p><span style=\"--darkreader-inline-color:#fe3a33;color:#fe2c24\">\u4e66\u63a5\u4e0a\u6587&#xff1a;Java EE \u8fdb\u9636&#xff1a;4.Spring Web MVC \u5165\u95e8&#xff08;\u7b2c\u4e09\u5f39&#xff09;~~<\/span><\/p>\n<h2 id=\"3.%E7%BB%BC%E5%90%88%E6%80%A7%E7%BB%83%E4%B9%A0\">3.\u7efc\u5408\u6027\u7ec3\u4e60<\/h2>\n<p>\u7ed3\u5408\u4e0a\u8ff0\u5185\u5bb9&#xff0c;\u6211\u4eec\u53ef\u4ee5\u505a\u4e00\u4e9b\u5c0f\u6848\u4f8b<\/p>\n<p>\u4e3b\u8981\u638c\u63e1\u77e5\u8bc6\u70b9&#xff1a;<\/p>\n<p>1.\u7406\u89e3\u524d\u540e\u7aef\u4ea4\u4e92\u8fc7\u7a0b<\/p>\n<p>2.\u63a5\u53e3\u4f20\u53c2&#xff0c;\u6570\u636e\u8fd4\u56de&#xff0c;\u4ee5\u53ca\u9875\u9762\u5c55\u793a<\/p>\n<h3 id=\"3.1%20%E5%8A%A0%E6%B3%95%E8%AE%A1%E7%AE%97%E5%99%A8\">3.1 \u52a0\u6cd5\u8ba1\u7b97\u5668<\/h3>\n<p>\u00a0\u9700\u6c42&#xff1a;\u8f93\u5165\u4e24\u4e2a\u6574\u6570&#xff0c;\u70b9\u51fb\u201d\u70b9\u51fb\u76f8\u52a0\u201c\u6309\u94ae&#xff0c;\u663e\u793a\u8ba1\u7b97\u7ed3\u679c<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"258\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154735-6ae60d973089c.png\" width=\"504\" \/><\/p>\n<h4 id=\"3.1.1%20%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C\">3.1.1 \u51c6\u5907\u5de5\u4f5c<\/h4>\n<p>\u00a0\u521b\u5efa SpringBoot \u9879\u76ee&#xff1a;\u5f15\u5165 Spring Web \u4f9d\u8d56&#xff0c;\u628a\u524d\u7aef\u9875\u9762\u653e\u5728\u9879\u76ee\u4e2d<\/p>\n<p>\u7801\u4e91\u5730\u5740&#xff1a;JavaEE \u8fdb\u9636\u8bfe\u7a0b\u8d44\u6599\u5305<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"323\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154735-6ae60d9748af0.png\" width=\"439\" \/><\/p>\n<h4 id=\"3.1.2%20%E7%BA%A6%E5%AE%9A%E5%89%8D%E5%90%8E%E7%AB%AF%E4%BA%A4%E4%BA%92%E6%8E%A5%E5%8F%A3\">3.1.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3<\/h4>\n<h5 id=\"%E6%A6%82%E5%BF%B5%E4%BB%8B%E7%BB%8D\">\u6982\u5ff5\u4ecb\u7ecd<\/h5>\n<p>\u7ea6\u5b9a\u201c\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3\u201d\u662f\u8fdb\u884c Web \u5f00\u53d1\u4e2d\u7684\u5173\u952e\u73af\u8282<\/p>\n<p>\u63a5\u53e3\u53c8\u53eb API&#xff08;Application Programming Interface&#xff09;&#xff0c;\u6211\u4eec\u4e00\u822c\u8bb2\u5230\u63a5\u53e3\u6216\u8005 API&#xff0c;\u6307\u7684\u90fd\u662f\u540c\u4e00\u4e2a\u4e1c\u897f<\/p>\n<p>\u662f\u6307\u5e94\u7528\u7a0b\u5e8f\u5bf9\u5916\u63d0\u4f9b\u7684\u670d\u52a1\u7684\u63cf\u8ff0&#xff0c;\u7528\u4e8e\u4ea4\u6362\u4fe1\u606f\u548c\u6267\u884c\u4efb\u52a1&#xff08;\u4e0e JavaSE \u9636\u6bb5\u5b66\u4e60\u7684[\u7c7b\u548c\u63a5\u53e3]\u4e2d\u7684\u63a5\u53e3\u662f\u4e24\u56de\u4e8b&#xff09;<\/p>\n<p>\u7b80\u5355\u6765\u8bf4&#xff0c;\u5c31\u662f\u5141\u8bb8\u5ba2\u6237\u7aef\u7ed9\u670d\u52a1\u5668\u53d1\u9001\u54ea\u4e9b HTTP \u8bf7\u6c42&#xff0c;\u5e76\u4e14\u6bcf\u79cd\u8bf7\u6c42\u9884\u671f\u83b7\u53d6\u4ec0\u4e48\u6837\u7684 HTTP \u54cd\u5e94<\/p>\n<p>\u73b0\u5728\u201c\u524d\u540e\u7aef\u5206\u79bb\u201d\u6a21\u5f0f\u5f00\u53d1&#xff0c;\u524d\u7aef\u548c\u540e\u7aef\u4ee3\u7801\u901a\u5e38\u7531\u4e0d\u540c\u7684\u56e2\u961f\u8d1f\u8d23\u5f00\u53d1&#xff0c;\u53cc\u65b9\u56e2\u961f\u5728\u5f00\u53d1\u4e4b\u524d&#xff0c;\u4f1a\u63d0\u524d\u7ea6\u5b9a\u597d\u4ea4\u4e92\u7684\u65b9\u5f0f&#xff0c;\u5ba2\u6237\u7aef\u53d1\u8d77\u8bf7\u6c42&#xff0c;\u670d\u52a1\u5668\u63d0\u4f9b\u5bf9\u5e94\u7684\u670d\u52a1&#xff0c;\u670d\u52a1\u5668\u63d0\u4f9b\u7684\u670d\u52a1\u79cd\u7c7b\u6709\u5f88\u591a&#xff0c;\u5ba2\u6237\u7aef\u6309\u7167\u53cc\u65b9\u7ea6\u5b9a\u6307\u5b9a\u9009\u62e9\u54ea\u4e00\u4e2a\u670d\u52a1<\/p>\n<p>\u63a5\u53e3&#xff0c;\u5176\u5b9e\u4e5f\u5c31\u662f\u6211\u4eec\u524d\u9762\u7f51\u7edc\u6a21\u5757\u8bb2\u7684\u201c\u5e94\u7528\u5c42\u534f\u8bae\u201d&#xff0c;\u628a\u7ea6\u5b9a\u7684\u5185\u5bb9\u5199\u5728\u6587\u6863\u4e0a&#xff0c;\u5c31\u662f\u201c\u63a5\u53e3\u6587\u6863\u201d&#xff0c;\u63a5\u53e3\u6587\u6863\u4e5f\u53ef\u4ee5\u7406\u89e3\u4e3a\u662f \u5e94\u7528\u7a0b\u5e8f\u7684\u201c\u64cd\u4f5c\u8bf4\u660e\u4e66\u201d<\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u6bd4\u5982\u513f\u7ae5\u7535\u8bdd\u73a9\u5177<\/span><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"902\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154735-6ae60d9761bcb.png\" width=\"890\" \/><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u63091&#xff1a;\u54cd\u5e94\u513f\u6b4c<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u63092&#xff1a;\u54cd\u5e94\u94a2\u7434\u4e50\u66f2<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u63093&#xff1a;\u5b89\u629a\u7761\u7720<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u63094&#xff1a;\u4ea4\u901a\u5de5\u5177\u97f3\u6548<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u2026\u2026<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u7b49\u7b49<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u4f46\u662f\u8fd9\u4e9b\u64cd\u4f5c\u8bf4\u660e&#xff0c;\u5982\u679c\u6ca1\u6709\u4e00\u4e2a\u6587\u6863\u6765\u8bf4\u660e&#xff0c;\u7528\u6237\u5c31\u4e0d\u592a\u6e05\u695a\u54ea\u4e2a\u6309\u952e\u5bf9\u5e94\u54ea\u4e2a&#xff0c;\u6240\u4ee5\u5546\u54c1\u4e00\u822c\u4f1a\u5e26\u4e00\u4e2a\u8bf4\u660e\u4e66<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u8fd9\u4e9b\u6309\u952e&#xff0c;\u5c31\u662f\u63a5\u53e3<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#54adef;color:#4da8ee\">\u8fd9\u4e2a\u201c\u8bf4\u660e\u4e66\u201d&#xff0c;\u5c31\u662f \u5e94\u7528\u7a0b\u5e8f\u7684\u201c\u63a5\u53e3\u6587\u6863\u201d<\/span><\/p>\n<p>\u5728\u9879\u76ee\u5f00\u53d1\u524d&#xff0c;\u6839\u636e\u9700\u6c42\u5148\u7ea6\u5b9a\u597d\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3&#xff0c;\u53cc\u65b9\u6309\u7167\u63a5\u53e3\u6587\u6863\u8fdb\u884c\u5f00\u53d1<\/p>\n<p>\u63a5\u53e3\u6587\u6863\u901a\u5e38\u7531\u670d\u52a1\u63d0\u4f9b\u65b9\u6765\u5199&#xff0c;\u4ea4\u7531\u670d\u52a1\u4f7f\u7528\u65b9\u786e\u8ba4&#xff0c;\u4e5f\u5c31\u662f\u5ba2\u6237\u7aef<\/p>\n<p>\u63a5\u53e3\u6587\u6863\u4e00\u65e6\u5199\u597d&#xff0c;\u5c3d\u91cf\u4e0d\u8981\u8f7b\u6613\u6539\u53d8<\/p>\n<p>\u5982\u82e5\u9700\u8981\u6539\u53d8&#xff0c;\u5fc5\u987b\u8981\u901a\u77e5\u53e6\u4e00\u65b9\u77e5\u6653\u5e76\u4fee\u6539\u63a5\u53e3\u6587\u6863&#xff08;\u670d\u52a1\u63d0\u4f9b\u65b9\u6765\u5199\u6765\u6539&#xff09;<\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u95f2\u804a&#xff1a;<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4ee5\u540e\u5728\u516c\u53f8\u4e2d\u5de5\u4f5c&#xff0c;\u9488\u5bf9\u6bcf\u4e00\u4e2a\u9879\u76ee&#xff1a;<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u2460\u63d0\u51fa\u9700\u6c42<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4ea7\u54c1\u7ecf\u7406\u2192\u7f16\u5199\u9700\u6c42\u6587\u6863\u2192\u8bc4\u5ba1\u9700\u6c42\u6587\u6863&#xff0c;\u8fd9\u4e2a\u8bc4\u5ba1&#xff0c;\u5206\u4e3a\u5185\u90e8\u8bc4\u5ba1\u548c\u5916\u90e8\u8bc4\u5ba1&#xff0c;\u5916\u90e8\u8bc4\u5ba1&#xff1a;\u524d\u540e\u7aef\u5f00\u53d1\u4eba\u5458\u3001\u6d4b\u8bd5\u4eba\u5458\u3001\u8fd0\u7ef4\u4eba\u5458 \u7b49\u7b49\u76f8\u5173\u4eba\u5458\u4e00\u8d77\u201c\u6307\u6307\u70b9\u70b9\u201d<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4e00\u5f00\u59cb\u4ea7\u54c1\u7ecf\u7406\u7684\u85aa\u8d44\u6ca1\u6709\u5f00\u53d1\u4eba\u5458\u9ad8&#xff0c;\u4f46\u662f\u5e72\u4e0a\u4e2a\u4e09\u4e94\u5e74\u4e86\u4e4b\u540e&#xff0c;\u5c31\u4f1a\u6bd4\u5f00\u53d1\u4eba\u5458\u9ad8\u4e0d\u5c11\u4e86~~<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u2461\u5f00\u53d1\u9636\u6bb5<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">1&#xff09;\u65b9\u6848\u8bbe\u8ba1\u3001\u8bc4\u5ba1<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">2&#xff09;\u6392\u671f&#xff1a;<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u63a5\u53e3\u6587\u6863\u4ec0\u4e48\u65f6\u5019\u63d0\u4f9b<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4ec0\u4e48\u65f6\u5019\u5f00\u53d1\u5b8c\u6210<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4ec0\u4e48\u65f6\u5019\u81ea\u6d4b\u5b8c\u6210<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4ec0\u4e48\u65f6\u5019\u8054\u8c03<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u4ec0\u4e48\u65f6\u5019\u4e0a\u7ebf<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">3&#xff09;\u63d0\u4f9b\u63a5\u53e3\u6587\u6863<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u63d0\u4f9b\u63a5\u53e3\u6587\u6863\u4ee5\u53ca\u76f8\u5e94\u4f9d\u8d56&#xff08;\u53ef\u80fd&#xff09;&#xff0c;\u8fd9\u4e2a\u63a5\u53e3\u4e5f\u8981\u8bc4\u5ba1&#xff08;\u975e\u6b63\u5f0f&#xff09;<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u5404\u81ea\u8fdb\u884c\u5f00\u53d1<\/span><\/p>\n<h5 id=\"%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90\">\u9700\u6c42\u5206\u6790<\/h5>\n<p>\u52a0\u6cd5\u8ba1\u7b97\u5668\u529f\u80fd&#xff0c;\u5bf9\u4e24\u4e2a\u6574\u6570\u8fdb\u884c\u76f8\u52a0&#xff0c;\u9700\u8981\u5ba2\u6237\u7aef\u63d0\u4f9b\u53c2\u4e0e\u8ba1\u7b97\u7684\u4e24\u4e2a\u6570&#xff0c;\u670d\u52a1\u7aef\u8fd4\u56de\u8fd9\u4e24\u4e2a\u6574\u6570\u8ba1\u7b97\u7684\u7ed3\u679c<\/p>\n<p>\u57fa\u4e8e\u4ee5\u4e0a\u5206\u6790&#xff0c;\u6211\u4eec\u6765\u5b9a\u4e49\u63a5\u53e3<\/p>\n<h5 id=\"%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89\">\u63a5\u53e3\u5b9a\u4e49<\/h5>\n<p>\u63a5\u53e3\u5b9a\u4e49<\/p>\n<p>\u529f\u80fd&#xff1a;\u4e24\u4e2a\u6570\u76f8\u52a0<\/p>\n<p>\u8def\u5f84&#xff1a;calc\/add\u3001calc\/plus\u3001add\u3001plus \u7b49\u90fd\u53ef\u4ee5&#xff08;\u5efa\u8bae 2~4\u7ea7\u8def\u5f84&#xff09;<\/p>\n<p> \u8bf7\u6c42\u8def\u5f84: calc\/sum<\/p>\n<p>\u8bf7\u6c42\u65b9\u5f0f: GET\/POST<\/p>\n<p>\u63a5\u53e3\u63cf\u8ff0: \u8ba1\u7b97\u4e24\u4e2a\u6574\u6570\u76f8\u52a0 <\/p>\n<h5 id=\"%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0\">\u8bf7\u6c42\u53c2\u6570<\/h5>\n<p>\u53c2\u6570&#xff1a;\u5b8c\u6210\u8fd9\u4e2a\u529f\u80fd&#xff0c;\u9700\u8981\u54ea\u4e9b\u53c2\u6570<\/p>\n<table>\n<tr>\n<p>\u53c2\u6570\u540d<\/p>\n<p>\u7c7b\u578b<\/p>\n<p>\u662f\u5426\u5fc5\u987b<\/p>\n<p>\u5907\u6ce8<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>num1<\/p>\n<\/td>\n<td>\n<p>Integer<\/p>\n<\/td>\n<td>\n<p>\u662f<\/p>\n<\/td>\n<td>\n<p>\u53c2\u4e0e\u8ba1\u7b97\u7684\u7b2c\u4e00\u4e2a\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>num2<\/p>\n<\/td>\n<td>\n<p>Integer<\/p>\n<\/td>\n<td>\n<p>\u662f<\/p>\n<\/td>\n<td>\n<p>\u53c2\u4e0e\u8ba1\u7b97\u7684\u7b2c\u4e8c\u4e2a\u6570<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"267\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154735-6ae60d97f2595.png\" width=\"1755\" \/><\/p>\n<p>\u540d\u5b57\u8981\u6709\u542b\u4e49&#xff0c;\u4e0d\u8981\u4f7f\u7528 abc\u3001aa\u3001bb \u7b49\u65e0\u542b\u4e49\u7684\u53d8\u91cf&#xff0c;\u4e0d\u8981\u4f7f\u7528\u62fc\u97f3<\/p>\n<p>\u793a\u4f8b&#xff1a;num1&#061;5&amp;num2&#061;3<\/p>\n<h5 id=\"%E5%93%8D%E5%BA%94%E6%95%B0%E6%8D%AE\">\u54cd\u5e94\u6570\u636e<\/h5>\n<p>\u8fd4\u56de\u7c7b\u578b&#xff1a;String\u3001Integer\u3001Long\u2026\u2026<\/p>\n<p> Content-Type: text\/html<\/p>\n<p>\u54cd\u5e94\u5185\u5bb9&#xff1a;\u8ba1\u7b97\u673a\u8ba1\u7b97\u7ed3\u679c&#xff1a;8 <\/p>\n<p>\u670d\u52a1\u5668\u7ed9\u6d4f\u89c8\u5668\u8fd4\u56de\u8ba1\u7b97\u7684\u7ed3\u679c<\/p>\n<h4 id=\"3.1.3%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BB%A3%E7%A0%81\" style=\"--darkreader-inline-bgcolor:transparent;background-color:transparent\">3.1.3 \u670d\u52a1\u5668\u4ee3\u7801<\/h4>\n<p> package com.bite.spring.demo;<br \/>\nimport org.springframework.web.bind.annotation.RequestMapping;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<br \/>\n\/**<br \/>\n * Created with IntelliJ IDEA.<br \/>\n * Description:<br \/>\n * User: CoderYanger<br \/>\n * Date: 2026-10-23<br \/>\n * Time: 17:45<br \/>\n *\/<br \/>\n&#064;RequestMapping(&#034;\/calc&#034;)<br \/>\n\/\/&#064;RestController \u8868\u793a\u8fd4\u56de\u6570\u636e &#064;Controller \u8868\u793a\u8fd4\u56de\u89c6\u56fe<br \/>\n&#064;RestController<br \/>\npublic class CalcController {<br \/>\n    &#064;RequestMapping(&#034;\/sum&#034;)<br \/>\n    public String sum(Integer num1,Integer num2){<br \/>\n        if(num1&#061;&#061;null||num2&#061;&#061;null){<br \/>\n            return &#034;\u53c2\u6570\u4e0d\u5408\u6cd5&#xff0c;\u8bf7\u68c0\u67e5\u540e\u518d\u63d0\u4ea4&#034;;<br \/>\n        }<br \/>\n        Integer sum&#061;num1&#043;num2;<br \/>\n        return &#034;&lt;h1&gt;\u8ba1\u7b97\u5668\u8ba1\u7b97\u7ed3\u679c&#xff1a;&#034;&#043;sum&#043;&#034;&lt;\/h1&gt;&#034;;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u7528 Postman \u6d4b\u8bd5&#x1f447;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"637\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154736-6ae60d9855ef8.png\" width=\"1077\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"633\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154736-6ae60d98ca9bf.png\" width=\"1087\" \/><\/p>\n<p>\u53d1\u73b0\u81ea\u6d4b\u6ca1\u95ee\u9898<\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u95f2\u804a&#xff1a;\u5bf9\u4e8e\u6211\u4eec\u540e\u7aef&#xff0c;\u7528 Postman \u6216\u8005 \u6d4f\u89c8\u5668 \u81ea\u6d4b\u6ca1\u95ee\u9898&#xff0c;\u90a3\u4e48 95%\u4ee5\u4e0a\u90fd\u662f\u6ca1\u95ee\u9898\u7684&#xff0c;\u5269\u4e0b\u7684\u4e0d\u5230 5% \u53ef\u80fd\u662f \u6d4f\u89c8\u5668 \u548c Postman \u7684\u4e00\u4e9b\u5c55\u793a\u4e0a\u7684\u95ee\u9898&#xff0c;\u8fd9\u65f6\u5019\u901a\u8fc7\u6293\u5305\u53bb\u770b\u4e00\u4e0b\u4e24\u8005\u7684 \u8bf7\u6c42 \u662f\u5426 \u5b8c\u5168\u4e00\u81f4&#xff0c;\u5f53\u7136&#xff0c;\u8fd9\u4e9b\u7ec6\u5fae\u7684\u5dee\u5f02\u6211\u4eec\u540e\u7aef\u90fd\u662f\u4e0d\u5173\u6ce8\u7684&#xff0c;\u4f7f\u7528\u5176\u4e2d\u4efb\u610f\u4e00\u4e2a\u81ea\u6d4b\u6ca1\u95ee\u9898\u6211\u4eec\u5c31\u53ef\u4ee5\u8ba4\u4e3a\u6ca1\u95ee\u9898\u4e86~~<\/span><\/p>\n<h4 id=\"3.1.4%20%E8%B0%83%E6%95%B4%E5%89%8D%E7%AB%AF%E9%A1%B5%E9%9D%A2%E4%BB%A3%E7%A0%81\">3.1.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801<\/h4>\n<p>\u00a0\u6dfb\u52a0\u8bbf\u95ee url \u548c\u8bf7\u6c42\u65b9\u5f0f<\/p>\n<\/p>\n<p> &lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<br \/>\n&lt;head&gt;<br \/>\n    &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n    &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n    &lt;title&gt;Document&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;!&#8211;    \u590d\u4e60&#xff1a;form\u662f\u4e2a\u8868\u5355\u57df&#xff0c;\u7528\u4e8e\u63d0\u4ea4\u6570\u636e&#8211;&gt;<br \/>\n     &lt;form action&#061;&#034;calc\/sum&#034; method&#061;&#034;post&#034;&gt;<br \/>\n&lt;!&#8211;         calc\/sum &#xff1a;\u63d0\u4ea4\u7684URL&#xff0c;post&#xff1a;\u63d0\u4ea4\u65b9\u5f0f&#8211;&gt;<br \/>\n        &lt;h1&gt;\u8ba1\u7b97\u5668&lt;\/h1&gt;<br \/>\n&lt;!&#8211;         \u53c2\u6570&#xff1a;key\u5bf9\u5e94input\u7684name\u503c&#8211;&gt;<br \/>\n        \u6570\u5b571&#xff1a;&lt;input name&#061;&#034;num1&#034; type&#061;&#034;text&#034;&gt;&lt;br&gt;<br \/>\n        \u6570\u5b572&#xff1a;&lt;input name&#061;&#034;num2&#034; type&#061;&#034;text&#034;&gt;&lt;br&gt;<br \/>\n        &lt;input type&#061;&#034;submit&#034; value&#061;&#034; \u70b9\u51fb\u76f8\u52a0 &#034;&gt;<br \/>\n&lt;!&#8211;        \u63d0\u4ea4\u6309\u94ae\u4f1a\u628a\u81ea\u5df1\u6240\u5728\u7684\u8868\u5355\u57df\u5185\u7684\u5185\u5bb9\u8fdb\u884c\u63d0\u4ea4&#8211;&gt;<br \/>\n    &lt;\/form&gt;<br \/>\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt; <\/p>\n<h4 id=\"3.1.5%20%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95\">3.1.5 \u8fd0\u884c\u6d4b\u8bd5<\/h4>\n<p>\u00a0\u542f\u52a8\u670d\u52a1&#xff0c;\u8fd0\u884c\u5e76\u6d4b\u8bd5<\/p>\n<p>\u00a0\u6ce8\u610f&#xff0c;\u53f3\u4e0a\u89d2\u7ed9\u51fa\u7684\u8bbf\u95ee\u65b9\u5f0f\u4e0d\u8981\u70b9&#x1f447;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"160\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154737-6ae60d9935be0.png\" width=\"435\" \/><\/p>\n<p>\u4e0d\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e9b\u65b9\u5f0f\u8bbf\u95ee&#xff0c;\u5982\u679c\u4e0d\u4fe1\u5c31\u70b9\u8fdb\u53bb\u770b&#xff0c;\u53d1\u73b0\u53ea\u80fd\u67e5\u770b\u9875\u9762&#xff0c;URL \u4e5f\u53d8\u4e86&#xff0c;\u8fd9\u53ea\u80fd\u67e5\u770b\u524d\u7aef\u9875\u9762&#xff0c;\u5e76\u6ca1\u6709\u8d70\u54b1\u4eec\u7684\u540e\u7aef&#x1f447;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"882\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154737-6ae60d994d41a.png\" width=\"1917\" \/><\/p>\n<p>\u5e94\u8be5\u7528\u6211\u4eec\u81ea\u5df1\u670d\u52a1\u63d0\u4f9b\u7684\u9875\u9762&#x1f447;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"892\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154737-6ae60d99e23ab.png\" width=\"1917\" \/><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u5206\u522b\u7528\u8fd9\u4e24\u79cd\u65b9\u5f0f\u6d4b\u8bd5\u4e00\u4e0b&#x1f447;<\/p>\n<p>\u8ba1\u7b97\u5668\u524d\u540e\u7aef\u4ea4\u4e92\u6f14\u793a<\/p>\n<\/p>\n<h3 id=\"3.2%20%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95\">3.2 \u7528\u6237\u767b\u5f55<\/h3>\n<p>\u9700\u6c42&#xff1a;\u7528\u6237\u8f93\u5165\u8d26\u53f7\u548c\u5bc6\u7801&#xff0c;\u540e\u7aef\u8fdb\u884c\u6821\u9a8c\u5bc6\u7801\u662f\u5426\u6b63\u786e<\/p>\n<p>1.\u5982\u679c\u4e0d\u6b63\u786e&#xff0c;\u524d\u7aef\u8fdb\u884c\u7528\u6237\u544a\u77e5<\/p>\n<p>2.\u5982\u679c\u6b63\u786e&#xff0c;\u8df3\u8f6c\u5230\u9996\u9875&#xff0c;\u9996\u9875\u663e\u793a\u5f53\u524d\u767b\u5f55\u7528\u6237<\/p>\n<p>3.\u540e\u7eed\u518d\u8bbf\u95ee\u9996\u9875&#xff0c;\u53ef\u4ee5\u83b7\u53d6\u5230\u767b\u5f55\u7528\u6237\u4fe1\u606f<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"229\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154738-6ae60d9a83d55.png\" width=\"1216\" \/><\/p>\n<h4 id=\"3.2.1%20%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C\">3.2.1 \u51c6\u5907\u5de5\u4f5c<\/h4>\n<p>\u00a0\u628a\u524d\u7aef\u9875\u9762\u653e\u5728\u9879\u76ee\u4e2d&#xff08;\u8bfe\u4ef6\u4e2d\u63d0\u4f9b&#xff09;<\/p>\n<p>\u7801\u4e91\u5730\u5740&#xff1a;JavaEE \u8fdb\u9636\u8bfe\u7a0b\u8d44\u6599\u5305<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"235\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154738-6ae60d9aabc64.png\" width=\"449\" \/><\/p>\n<h4 id=\"3.2.2%20%E7%BA%A6%E5%AE%9A%E5%89%8D%E5%90%8E%E7%AB%AF%E4%BA%A4%E4%BA%92%E6%8E%A5%E5%8F%A3\">3.2.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3<\/h4>\n<h5 id=\"%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90\" style=\"--darkreader-inline-bgcolor:transparent;background-color:transparent\">\u9700\u6c42\u5206\u6790<\/h5>\n<p>\u5bf9\u4e8e\u540e\u7aef\u5f00\u53d1\u4eba\u5458\u800c\u8a00&#xff0c;\u4e0d\u6d89\u53ca\u524d\u7aef\u9875\u9762\u7684\u5c55\u793a&#xff0c;\u53ea\u9700\u8981\u63d0\u4f9b\u4e24\u4e2a\u529f\u80fd<\/p>\n<p>1.\u767b\u5f55\u9996\u9875&#xff1a;\u901a\u8fc7\u8d26\u53f7\u548c\u5bc6\u7801&#xff0c;\u6821\u9a8c\u8f93\u5165\u7684\u8d26\u53f7\u5bc6\u7801\u662f\u5426\u6b63\u786e&#xff0c;\u5e76\u544a\u77e5\u524d\u7aef<\/p>\n<p>2.\u9996\u9875&#xff1a;\u544a\u77e5\u524d\u7aef\u5f53\u524d\u767b\u5f55\u7528\u6237&#xff0c;\u5982\u679c\u5f53\u524d\u5df2\u6709\u7528\u6237\u767b\u5f55&#xff0c;\u8fd4\u56de\u767b\u5f55\u7684\u8d26\u53f7&#xff0c;\u5982\u679c\u6ca1\u6709&#xff0c;\u8fd4\u56de\u7a7a<\/p>\n<h5 id=\"%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89\">\u63a5\u53e3\u5b9a\u4e49<\/h5>\n<h6 id=\"%E6%A0%A1%E9%AA%8C%E6%8E%A5%E5%8F%A3\">\u6821\u9a8c\u63a5\u53e3<\/h6>\n<p> \u8bf7\u6c42\u8def\u5f84&#xff1a;\/user\/login<br \/>\n\u8bf7\u6c42\u65b9\u5f0f&#xff1a;POST<br \/>\n\u63a5\u53e3\u63cf\u8ff0&#xff1a;\u6821\u9a8c\u8d26\u53f7\u5bc6\u7801\u662f\u5426\u6b63\u786e <\/p>\n<h6 id=\"%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0\">\u8bf7\u6c42\u53c2\u6570<\/h6>\n<table>\n<tr>\n<p>\u53c2\u6570\u540d<\/p>\n<p>\u7c7b\u578b<\/p>\n<p>\u662f\u5426\u5fc5\u987b<\/p>\n<p>\u5907\u6ce8<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>userName<\/p>\n<\/td>\n<td>\n<p>String<\/p>\n<\/td>\n<td>\n<p>\u662f<\/p>\n<\/td>\n<td>\n<p>\u6821\u9a8c\u7684\u8d26\u53f7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>password<\/p>\n<\/td>\n<td>\n<p>String<\/p>\n<\/td>\n<td>\n<p>\u662f<\/p>\n<\/td>\n<td>\n<p>\u6821\u9a8c\u7684\u5bc6\u7801<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6 id=\"%E5%93%8D%E5%BA%94%E6%95%B0%E6%8D%AE\">\u54cd\u5e94\u6570\u636e<\/h6>\n<p> Content-Type: text\/html<br \/>\n\u54cd\u5e94\u5185\u5bb9&#xff1a;<br \/>\ntrue \/\/\u8d26\u53f7\u5bc6\u7801\u9a8c\u8bc1\u6210\u529f<br \/>\nfalse \/\/\u8d26\u53f7\u5bc6\u7801\u9a8c\u8bc1\u5931\u8d25 <\/p>\n<h6 id=\"%E6%9F%A5%E8%AF%A2%E7%99%BB%E5%BD%95%E7%94%A8%E6%88%B7%E6%8E%A5%E5%8F%A3\" style=\"--darkreader-inline-bgcolor:transparent;background-color:transparent\">\u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3<\/h6>\n<p> \u8bf7\u6c42\u8def\u5f84&#xff1a;\/user\/getLoginUser<br \/>\n\u8bf7\u6c42\u65b9\u5f0f&#xff1a;GET<br \/>\n\u63a5\u53e3\u63cf\u8ff0&#xff1a;\u67e5\u8be2\u5f53\u524d\u767b\u5f55\u7684\u7528\u6237 <\/p>\n<h6 id=\"%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0\">\u8bf7\u6c42\u53c2\u6570<\/h6>\n<p>\u65e0<\/p>\n<h6 id=\"%E5%93%8D%E5%BA%94%E6%95%B0%E6%8D%AE\">\u54cd\u5e94\u6570\u636e<\/h6>\n<p> Content-Type: text\/html<br \/>\n\u54cd\u5e94\u5185\u5bb9:<br \/>\nzhangsan <\/p>\n<p>\u8fd4\u56de\u5f53\u524d\u767b\u5f55\u7684\u7528\u6237<\/p>\n<h4 id=\"3.2.3%20%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E4%BB%A3%E7%A0%81\">3.2.3 \u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u4ee3\u7801<\/h4>\n<h5 id=\"%E6%A0%A1%E9%AA%8C%E6%8E%A5%E5%8F%A3\">\u6821\u9a8c\u63a5\u53e3<\/h5>\n<p> import jakarta.servlet.http.HttpSession;<br \/>\nimport org.springframework.util.StringUtils;<br \/>\nimport org.springframework.web.bind.annotation.RequestMapping;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<\/p>\n<p>&#064;RestController<br \/>\n&#064;RequestMapping(&#034;\/user&#034;)<br \/>\npublic class LoginController {<\/p>\n<p>    \/**<br \/>\n     * \u6821\u9a8c\u7528\u6237\u8d26\u53f7\u548c\u5bc6\u7801\u662f\u5426\u6b63\u786e<br \/>\n     * &#064;param userName<br \/>\n     * &#064;param password<br \/>\n     * &#064;param session<br \/>\n     * &#064;return<br \/>\n     *\/<\/p>\n<p>    &#064;RequestMapping(&#034;\/login&#034;)<br \/>\n    public boolean login(String userName, String password, HttpSession session)<br \/>\n    {<br \/>\n        \/\/\u8d26\u53f7\u6216\u5bc6\u7801\u4e3a\u7a7a<br \/>\n        if(!StringUtils.hasLength(userName) ||<br \/>\n                !StringUtils.hasLength(password)){<br \/>\n            return false;<br \/>\n        }<br \/>\n        \/\/\u6821\u9a8c\u8d26\u53f7\u5bc6\u7801\u662f\u5426\u6b63\u786e<br \/>\n        \/\/\u7406\u8bba\u4e0a\u5e94\u8be5\u4ece\u6570\u636e\u5e93\u4e2d\u83b7\u53d6\u8d26\u53f7\u5bc6\u7801&#xff0c;\u6821\u9a8c\u662f\u5426\u6b63\u786e&#xff0c;\u4f46\u5f53\u524d\u8fd8\u6ca1\u8bb2\u6570\u636e\u5e93\u7684\u64cd\u4f5c&#xff0c;\u5148\u628a\u8d26\u53f7\u5bc6\u7801\u56fa\u5b9a\u5199\u6b7b<br \/>\n        if (!&#034;zhangsan&#034;.equals(userName) || !&#034;123456&#034;.equals(password)){<br \/>\n            return false;<br \/>\n        }<br \/>\n        \/\/\u5bc6\u7801\u9a8c\u8bc1\u6210\u529f&#xff0c;\u628a\u7528\u6237\u540d\u5b58\u50a8\u5728Session\u4e2d<br \/>\n        session.setAttribute(&#034;userName&#034;,userName);<br \/>\n        return true;<br \/>\n    }<br \/>\n} <\/p>\n<p>StringUtiles.hasLength() \u662f Spring \u63d0\u4f9b\u7684\u4e00\u4e2a\u5de5\u5177\u65b9\u6cd5&#xff0c;\u5224\u65ad\u5b57\u7b26\u4e32\u662f\u5426\u6709\u503c<\/p>\n<p>\u5b57\u7b26\u4e32\u4e3a null \u6216\u8005\u201c\u201d\u65f6&#xff0c;\u8fd4\u56de false&#xff0c;\u5176\u4ed6\u8fd4\u56de true<\/p>\n<p> public static boolean hasLength(&#064;Nullable String str) {<br \/>\n    return str !&#061; null &amp;&amp; !str.isEmpty();<br \/>\n} <\/p>\n<p>\u7b49\u6211\u4eec\u540e\u7eed\u63a5\u89e6\u591a\u4e86&#xff0c;\u4e00\u770b\u5230 Utiles \u5c31\u77e5\u9053\u5b83\u662f\u4e2a\u5de5\u5177\u7c7b&#xff0c;\u8fd9\u91cc\u6709\u5f88\u591a\u5b9e\u7528\u7684\u5de5\u5177&#x1f447;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"787\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154738-6ae60d9ac3705.png\" width=\"1203\" \/><\/p>\n<p>\u5de5\u5177\u7c7b\u7684\u547d\u540d\u901a\u5e38\u662f\u4f60\u5bf9\u4e8e\u54ea\u4e00\u5757\u5904\u7406\u7684&#xff0c;\u524d\u9762\u5c31\u52a0\u4ec0\u4e48&#xff0c;\u6bd4\u5982\u8bf4\u4f60\u5bf9\u4e8e String &#xff0c;\u5bf9\u5b57\u7b26\u4e32\u7684\u4e00\u4e2a\u5de5\u5177\u7c7b&#xff0c;\u5c31\u662f StringUtils&#xff0c;\u5982\u679c\u4f60\u662f\u5bf9\u4e8e\u65e5\u671f\u7684\u5de5\u5177\u7c7b&#xff0c;\u5de5\u5177\u7c7b\u5c31\u53eb DateUtils&#xff0c;\u7136\u540e\u4f60\u5bf9\u4e8e Long \u7684\u5904\u7406&#xff0c;\u5c31\u53eb LongUtils&#xff0c;\u8fd9\u4e5f\u7b97\u6211\u4eec\u4e00\u4e2a\u4e0d\u6210\u6587\u7684\u547d\u540d\u89c4\u77e9&#xff0c;\u4f46\u5927\u5bb6\u90fd\u77e5\u9053&#xff0c;\u6bd4\u5982 NumberUtils\u3001TypeUtils&#x1f447;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"328\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154739-6ae60d9b507a8.png\" width=\"376\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"289\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154739-6ae60d9b9adf2.png\" width=\"375\" \/><\/p>\n<h5 id=\"%E6%9F%A5%E8%AF%A2%E7%99%BB%E5%BD%95%E7%94%A8%E6%88%B7%E6%8E%A5%E5%8F%A3\">\u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3<\/h5>\n<p> package com.bite.spring.demo;<\/p>\n<p>import org.springframework.util.StringUtils;<br \/>\nimport org.springframework.web.bind.annotation.RequestMapping;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<\/p>\n<p>\/**<br \/>\n * Created with IntelliJ IDEA.<br \/>\n * Description:<br \/>\n * User: CoderYanger<br \/>\n * Date: 2026-10-23<br \/>\n * Time: 20:03<br \/>\n *\/<br \/>\n&#064;RequestMapping(&#034;\/user&#034;)<br \/>\n&#064;RestController<br \/>\npublic class UserController {<br \/>\n    &#064;RequestMapping(&#034;\/login&#034;)<br \/>\n    public Boolean login(String userName,String password){<br \/>\n        \/\/\u53c2\u6570\u6821\u9a8c<br \/>\n\/\/        if(userName!&#061;null||userName&#061;&#061;&#034;&#034;||password&#061;&#061;null||password&#061;&#061;&#034;&#034;){<br \/>\n\/\/            return false;<br \/>\n\/\/        }<br \/>\n\/\/        \u4e0a\u8ff0\u4ee3\u7801\u5199\u7740\u592a\u9ebb\u70e6&#xff0c;\u6211\u4eec\u6709\u66f4\u7b80\u6d01\u7684\u5199\u6cd5&#x1f447;<br \/>\n        if(!StringUtils.hasLength(userName)||!StringUtils.hasLength(password)){<br \/>\n            return false;<br \/>\n        }<br \/>\n        \/\/\u6821\u9a8c\u7528\u6237\u540d\u548c\u5bc6\u7801\u662f\u5426\u6b63\u786e<br \/>\n        \/\/\u8fd8\u672a\u5b66\u4e60\u6570\u636e\u5e93\u76f8\u5173\u7684\u64cd\u4f5c&#xff0c;\u6682\u4e14\u628a\u8d26\u53f7\u548c\u5bc6\u7801\u5199\u6b7b admin admin<br \/>\n        if(&#034;admin&#034;.equals(userName)&amp;&amp;&#034;admin&#034;.equals(password)){<br \/>\n            return true;<br \/>\n        }<br \/>\n        return false;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u6ce8\u610f\u70b9\u2460&#xff1a;\u5f53\u7136\u8fd9\u79cd\u5199\u6cd5\u4e0d\u662f\u552f\u4e00\u7684&#xff0c;\u6bd4\u5982\u4e0a\u8ff0\u4ee3\u7801\u53ef\u4ee5\u5199\u6210&#x1f447;&#xff0c;\u4f46\u8fd8\u662f\u5efa\u8bae\u5199\u6210\u4e0a\u8ff0\u4ee3\u7801&#xff08;\u56e0\u4e3a\u597d\u770b~~&#xff09;<\/p>\n<p>     public Boolean login2(String userName,String password){<br \/>\n        \/\/\u53c2\u6570\u6821\u9a8c<br \/>\n        if(StringUtils.hasLength(userName)&amp;&amp;StringUtils.hasLength(password)){<br \/>\n            if(&#034;admin&#034;.equals(userName)&amp;&amp;&#034;admin&#034;.equals(password)){<br \/>\n                return true;<br \/>\n            }<br \/>\n        }<br \/>\n        return false;<br \/>\n    } <\/p>\n<p>\u6211\u4eec\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\u8981\u6c42\u5d4c\u5957\u4e0d\u80fd\u8d85\u8fc7\u4e94\u5c42&#xff0c;\u5c42\u6570\u591a\u4e86\u4eba\u4e5f\u4f1a\u6655~~<\/p>\n<p>\u5176\u5b9e\u522b\u8bf4\u4e94\u5c42\u4e86&#xff0c;\u56db\u5c42\u57fa\u672c\u90fd\u6ca1\u6cd5\u770b\u4e86&#xff0c;\u6240\u4ee5\u6211\u4eec\u8981\u5c3d\u91cf\u51cf\u5c11\u5d4c\u5957~~<\/p>\n<p>\u6ce8\u610f\u70b9\u2461&#xff1a;\u4e3a\u5565\u5199\u6210 &#034;admin&#034;.equals(userName) \u800c\u4e0d\u662f userName.equals(&#034;admin&#034;)&#xff1f;&#xff1f;<\/p>\n<p>\u56e0\u4e3a equals \u4f1a\u62a5\u7a7a\u6307\u9488\u5f02\u5e38 NullpointException&#xff0c;\u5f53\u524d\u9762\u7684\u503c\u4e3a null \u65f6&#xff0c;\u5c31\u4f1a\u62a5\u7a7a\u6307\u9488\u5f02\u5e38&#xff0c;\u4f46\u662f\u540e\u9762\u90a3\u4e2a\u4e3a null \u5c31\u6ca1\u5173\u7cfb&#xff0c;\u6240\u4ee5\u6211\u4eec\u5728\u53bb\u5199\u7684\u65f6\u5019&#xff0c;\u901a\u5e38\u628a\u5e38\u91cf\u5199\u5728\u524d\u9762<\/p>\n<p><span style=\"--darkreader-inline-color:#ffa31a;color:#ff9900\">\u7b54\u7591&#xff1a;<\/span><\/p>\n<p><span style=\"--darkreader-inline-color:#ffa31a;color:#ff9900\">Q1&#xff1a;\u6211\u4eec\u524d\u9762\u4e0d\u662f\u6821\u9a8c\u8fc7\u4e86\u5417&#xff1f;&#xff1f;<\/span><\/p>\n<p>\u786e\u5b9e\u662f&#xff0c;\u4f46\u662f\u4f60\u80fd\u4fdd\u8bc1\u4ee5\u540e\u5199\u4ee3\u7801\u90fd\u4e0d\u5fd8\u8bb0\u5199\u6821\u9a8c\u5417&#xff1f;&#xff1f;\u6240\u4ee5\u6211\u4eec\u8fd8\u662f\u8981\u517b\u6210\u4e60\u60ef&#xff0c;\u907f\u514d\u5fd8\u5199\u65f6\u51fa Bug~~<\/p>\n<p><span style=\"--darkreader-inline-color:#ffa31a;color:#ff9900\">Q2&#xff1a;\u6821\u9a8c\u4e0d\u662f\u5e94\u8be5\u524d\u7aef\u505a\u5417&#xff1f;&#xff1f;<\/span><\/p>\n<p>\u6ca1\u9519&#xff0c;\u4f46\u662f\u540e\u7aef\u4e5f\u5f97\u5e72&#xff0c;\u53c2\u6570\u6821\u9a8c\u524d\u7aef\u540e\u7aef\u90fd\u8981\u5e72&#xff0c;\u524d\u7aef\u6821\u9a8c\u7684\u65f6\u5019\u4e0d\u8003\u8651\u540e\u7aef&#xff0c;\u540e\u7aef\u6821\u9a8c\u7684\u65f6\u5019\u4e0d\u8003\u8651\u524d\u7aef&#xff0c;\u5404\u5e72\u5404\u7684\u4e8b\u513f&#xff0c;\u524d\u540e\u7aef\u90fd\u5f97\u505a&#xff0c;\u4f60\u4e0d\u6821\u9a8c\u968f\u4fbf\u5199\u4e2a\u4ee3\u7801\u5c31\u6254\u7ed9\u524d\u7aef\u4e86&#xff0c;\u524d\u7aef\u4e00\u770b\u90fd\u8fd0\u884c\u4e0d\u8d77\u6765&#xff0c;\u80af\u5b9a\u4f1a\u9a82\u4f60\u7684&#xff0c;\u4e22\u4eba~~<\/p>\n<hr \/>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u81ea\u6d4b\u4e00\u4e0b&#x1f447;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"587\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154739-6ae60d9be1c42.png\" width=\"1067\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"640\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154740-6ae60d9c3ab1f.png\" width=\"1077\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"631\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154740-6ae60d9c8d34a.png\" width=\"1077\" \/><\/p>\n<p>\u53d1\u73b0\u6ca1\u95ee\u9898&#xff0c;\u63a5\u4e0b\u6765\u518d\u5199\u83b7\u53d6\u767b\u5f55\u7528\u6237\u4fe1\u606f\u7684\u4ee3\u7801&#xff0c;\u603b\u7684\u4ee3\u7801&#x1f447;<\/p>\n<p> package com.bite.spring.demo;<\/p>\n<p>import jakarta.servlet.http.HttpSession;<br \/>\nimport org.springframework.util.StringUtils;<br \/>\nimport org.springframework.web.bind.annotation.RequestMapping;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<\/p>\n<p>\/**<br \/>\n * Created with IntelliJ IDEA.<br \/>\n * Description:<br \/>\n * User: CoderYanger<br \/>\n * Date: 2026-10-23<br \/>\n * Time: 20:03<br \/>\n *\/<br \/>\n&#064;RequestMapping(&#034;\/user&#034;)<br \/>\n&#064;RestController<br \/>\npublic class UserController {<br \/>\n    &#064;RequestMapping(&#034;\/login&#034;)<br \/>\n    public Boolean login(String userName, String password, HttpSession session){<br \/>\n        \/\/\u53c2\u6570\u6821\u9a8c<br \/>\n\/\/        if(userName!&#061;null||userName&#061;&#061;&#034;&#034;||password&#061;&#061;null||password&#061;&#061;&#034;&#034;){<br \/>\n\/\/            return false;<br \/>\n\/\/        }<br \/>\n\/\/        \u4e0a\u8ff0\u4ee3\u7801\u5199\u7740\u592a\u9ebb\u70e6&#xff0c;\u6211\u4eec\u6709\u66f4\u7b80\u6d01\u7684\u5199\u6cd5&#x1f447;<br \/>\n        if(!StringUtils.hasLength(userName)||!StringUtils.hasLength(password)){<br \/>\n            return false;<br \/>\n        }<br \/>\n        \/\/\u6821\u9a8c\u7528\u6237\u540d\u548c\u5bc6\u7801\u662f\u5426\u6b63\u786e<br \/>\n        \/\/\u8fd8\u672a\u5b66\u4e60\u6570\u636e\u5e93\u76f8\u5173\u7684\u64cd\u4f5c&#xff0c;\u6682\u4e14\u628a\u8d26\u53f7\u548c\u5bc6\u7801\u5199\u6b7b admin admin<br \/>\n        if(&#034;admin&#034;.equals(userName)&amp;&amp;&#034;admin&#034;.equals(password)){<br \/>\n            \/\/\u5bc6\u7801\u6b63\u786e<br \/>\n            session.setAttribute(&#034;userName&#034;,userName);\/\/\u653e\u8fdbsession\u91cc<br \/>\n            return true;<br \/>\n        }<br \/>\n        return false;<br \/>\n    }<\/p>\n<p>    &#064;RequestMapping(&#034;\/getLoginUser&#034;)<br \/>\n    public String getLoginUser(HttpSession session){<br \/>\n        String userName&#061;(String)session.getAttribute(&#034;userName&#034;);<br \/>\n        return userName;<br \/>\n    }<br \/>\n\/\/    public Boolean login2(String userName,String password){<br \/>\n\/\/        \/\/\u53c2\u6570\u6821\u9a8c<br \/>\n\/\/        if(StringUtils.hasLength(userName)&amp;&amp;StringUtils.hasLength(password)){<br \/>\n\/\/            if(&#034;admin&#034;.equals(userName)&amp;&amp;&#034;admin&#034;.equals(password)){<br \/>\n\/\/                return true;<br \/>\n\/\/            }<br \/>\n\/\/        }<br \/>\n\/\/        return false;<br \/>\n\/\/    }<br \/>\n}<\/p>\n<p>\u7531\u4e8e\u4e00\u5f00\u59cb\u6211\u4eec\u5e76\u6ca1\u6709\u8bbe\u7f6e session&#xff0c;\u6240\u4ee5\u83b7\u53d6\u65f6\u662f\u7a7a\u7684&#x1f447;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"642\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154740-6ae60d9cdb613.png\" width=\"1090\" \/><\/p>\n<p>set \u7684\u8bdd&#xff0c;\u6211\u4eec\u5c31\u901a\u8fc7\u767b\u5f55\u6765 set \u4e86&#x1f447;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"635\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154741-6ae60d9d3654b.png\" width=\"1067\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u5c31\u80fd\u83b7\u53d6\u767b\u5f55\u7528\u6237\u4fe1\u606f\u4e86&#x1f447;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"632\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154741-6ae60d9d8432f.png\" width=\"1083\" \/><\/p>\n<p>\u6b64\u65f6\u7b2c\u4e8c\u4e2a\u63a5\u53e3\u6211\u4eec\u4e5f\u6d4b\u8bd5\u5b8c\u6210\u4e86~~<\/p>\n<h4 id=\"3.2.4%20%E8%B0%83%E6%95%B4%E5%89%8D%E7%AB%AF%E9%A1%B5%E9%9D%A2%E4%BB%A3%E7%A0%81\">3.2.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801<\/h4>\n<h5 id=\"1.%E8%B0%83%E6%95%B4%E7%99%BB%E5%BD%95%E9%A1%B5%E9%9D%A2%20login.html\" style=\"--darkreader-inline-bgcolor:transparent;background-color:transparent\">1.\u8c03\u6574\u767b\u5f55\u9875\u9762 login.html<\/h5>\n<p>\u4e0a\u9762\u8ba1\u7b97\u5668\u7684\u4ee3\u7801\u6211\u4eec\u662f\u7528 form \u8868\u5355\u8fdb\u884c\u63d0\u4ea4\u7684&#xff0c;\u4f46\u662f\u5b83\u6709\u4e00\u4e2a\u7f3a\u70b9&#xff0c;\u5c31\u662f\u9875\u9762\u4e00\u5b9a\u4f1a\u53d1\u751f\u8df3\u8f6c&#xff0c;\u6240\u4ee5\u63a5\u4e0b\u6765\u6211\u4eec\u5b66\u4e60\u7528 Ajax \u53d1\u8d77\u8bf7\u6c42~~&#xff08;\u91cd\u70b9&#xff09;<\/p>\n<p>\u5565\u662f Ajax \u5462&#xff1f;&#xff1f;&#x1f447;ajax&#xff08;Web\u6570\u636e\u4ea4\u4e92\u65b9\u5f0f&#xff09;_\u767e\u5ea6\u767e\u79d1<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"210\" src=\"2026-10-31l1mmsifaac3.png\" width=\"1737\" \/><\/p>\n<p>\u539f\u751f\u7684 ajax \u5199\u8d77\u6765\u975e\u5e38\u9ebb\u70e6&#xff0c;\u73b0\u5728\u4e5f\u6ca1\u6709\u591a\u5c11\u4eba\u7528\u4e86&#xff0c;\u6240\u4ee5\u6211\u4eec\u5b66\u4e60\u7528 JQuery \u5b8c\u6210 Ajax \u64cd\u4f5c~~<\/p>\n<p>\u5bf9\u4e8e\u524d\u7aef\u800c\u8a00&#xff0c;\u5f53\u70b9\u51fb\u767b\u5f55\u6309\u94ae\u65f6&#xff0c;\u9700\u8981\u628a\u7528\u6237\u8f93\u5165\u7684\u4fe1\u606f\u4f20\u9012\u5230\u540e\u7aef\u8fdb\u884c\u6821\u9a8c&#xff0c;\u540e\u7aef\u6821\u9a8c\u6210\u529f&#xff0c;\u5219\u8df3\u8f6c\u5230\u9996\u9875&#xff1a;index.html&#xff0c;\u540e\u7aef\u6821\u9a8c\u5931\u8d25&#xff0c;\u5219\u76f4\u63a5\u5f39\u7a97<\/p>\n<p>login.html \u4ee3\u7801\u5c55\u793a&#x1f447;<\/p>\n<p> &lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<\/p>\n<p>&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n  &lt;title&gt;\u767b\u5f55\u9875\u9762&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n  &lt;h1&gt;\u7528\u6237\u767b\u5f55&lt;\/h1&gt;<br \/>\n  \u7528\u6237\u540d&#xff1a;&lt;input name&#061;&#034;userName&#034; type&#061;&#034;text&#034; id&#061;&#034;userName&#034;&gt;&lt;br&gt;<br \/>\n  \u5bc6\u7801&#xff1a;&lt;input name&#061;&#034;password&#034; type&#061;&#034;password&#034; id&#061;&#034;password&#034;&gt;&lt;br&gt;<br \/>\n  &lt;input type&#061;&#034;button&#034; value&#061;&#034;\u767b\u5f55&#034; onclick&#061;&#034;login()&#034;&gt;<\/p>\n<p>  &lt;script src&#061;&#034;https:\/\/cdn.bootcdn.net\/ajax\/libs\/jquery\/3.6.4\/jquery.min.js&#034;&gt;&lt;\/script&gt;<br \/>\n  &lt;script&gt;<br \/>\n    function login() {<br \/>\n      \/\/ \u5bf9\u8c61\u8981\u4f7f\u7528\u5927\u62ec\u53f7\u62ec\u8d77\u6765<br \/>\n      $.ajax({<br \/>\n        type:&#034;post&#034;,\/\/\u8bf7\u6c42\u7c7b\u578b<br \/>\n        url:&#034;\/user\/login&#034;,\/\/\u8bf7\u6c42\u8def\u5f84<br \/>\n        data:{\/\/\u8bf7\u6c42\u53c2\u6570<br \/>\n          \/\/ID\u524d\u9762\u52a0#&#xff0c;.val()\u62ff\u5230\u503c<br \/>\n          userName:$(&#034;#userName&#034;).val(),\/\/\u53d6input\u6846\u91cc\u7684\u503c<br \/>\n          password:$(&#034;#password&#034;).val()<br \/>\n        },<br \/>\n        \/\/HTTP\u8bf7\u6c42\u6210\u529f\u4e86&#xff0c;\u4e0d\u5173\u5fc3\u7ed9\u7684\u54cd\u5e94\u662f\u5565&#xff0c;\u8c03\u7528\u56de\u8c03\u51fd\u6570&#xff0c;\u63a5\u6536\u540e\u7aef\u53c2\u6570<br \/>\n        success:function(result){\/\/\u8fd9\u4e2aresult\u540d\u5b57\u968f\u4fbf\u5b9a\u4e49<br \/>\n          if(result){\/\/\u540e\u7aef\u8fd4\u56de\u7684result\u662fString&#xff0c;\u90a3\u5c31\u662fString&#xff0c;\u540e\u7aef\u8fd4\u56de\u7684\u662fJSON&#xff0c;\u90a3\u5c31\u662f\u5bf9\u8c61&#xff0c;\u5c31\u53ef\u4ee5\u7528.\u6765\u4f7f\u7528\u4e86<br \/>\n            \/\/\u540e\u7aef\u8fd4\u56detrue&#xff0c;\u8bf4\u660e\u5bc6\u7801\u6b63\u786e&#xff0c;\u8df3\u8f6c\u5230\u6307\u5b9a\u9875\u9762<br \/>\n            location.href&#061;&#034;index.html&#034;;<br \/>\n            \/\/location.assign(&#034;index.html&#034;);\/\/\u8fd9\u884c\u4ee3\u7801\u4e5f\u53ef\u4ee5\u5b8c\u6210\u9875\u9762\u8df3\u8f6c&#xff0c;\u4e86\u89e3\u5373\u53ef<br \/>\n          }else{<br \/>\n            \/\/\u5bc6\u7801\u9519\u8bef<br \/>\n            alert(&#034;\u5bc6\u7801\u9519\u8bef&#xff0c;\u8bf7\u786e\u8ba4&#034;);<br \/>\n          }<br \/>\n        }<br \/>\n      });<br \/>\n    }<\/p>\n<p>  &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt; <\/p>\n<p><span style=\"--darkreader-inline-color:#a8e250;color:#a2e043\">\u590d\u4e60&#xff1a;id \u524d\u52a0 #&#xff0c;class \u524d\u52a0 . &#xff0c;\u53d6\u503c\u548c\u8d4b\u503c\u90fd\u662f val()&#xff0c;\u53c2\u6570\u91cc\u9762\u65b9\u6cd5\u6ca1\u6709\u503c\u8868\u793a\u53d6\u503c<\/span><\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u6709\u7740\u5bf9\u5e94\u5173\u7cfb&#x1f447;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"497\" src=\"2026-10-31lcuo5rkec35.png\" width=\"1587\" \/><\/p>\n<p>\u9875\u9762\u8df3\u8f6c\u7684\u4e09\u79cd\u65b9\u5f0f&#xff1a;<\/p>\n<p>1.window.location.href&#061;&#034;book_list.html&#034;;<\/p>\n<p>2.window.location.assign(&#034;book_list.html&#034;);<\/p>\n<p>3.window.location.replace(&#034;book_list.html&#034;);<\/p>\n<p>\u4ee5\u4e0a\u5199\u6cd5&#xff0c;\u901a\u5e38\u628a\u201cwindow.\u201d\u7701\u7565&#xff0c;\u6bd4\u5982 window.location.href&#061;&#034;book_list.html&#034;;<\/p>\n<p>\u5199\u6210 location.href&#061;&#034;book_list.html&#034;;<\/p>\n<p>\u4e09\u8005\u533a\u522b\u53c2\u8003&#xff1a;location.assign()\u3001location.href\u3001location.replace(url)\u7684\u4e0d\u540c<\/p>\n<h5 id=\"2.%E8%B0%83%E6%95%B4%E9%A6%96%E9%A1%B5%E4%BB%A3%E7%A0%81\" style=\"--darkreader-inline-bgcolor:transparent;background-color:transparent\">2.\u8c03\u6574\u9996\u9875\u4ee3\u7801<\/h5>\n<p>\u00a0\u4e0b\u9762\u6211\u4eec\u518d\u628a index.html \u4ee3\u7801\u5199\u4e00\u4e0b&#xff0c;\u7136\u540e\u4e00\u8d77\u6d4b\u8bd5&#x1f447;<\/p>\n<p> &lt;!doctype html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<\/p>\n<p>&lt;head&gt;<br \/>\n    &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n    &lt;meta name&#061;&#034;viewport&#034;<br \/>\n        content&#061;&#034;width&#061;device-width, user-scalable&#061;no, initial-scale&#061;1.0, maximum-scale&#061;1.0, minimum-scale&#061;1.0&#034;&gt;<br \/>\n    &lt;meta http-equiv&#061;&#034;X-UA-Compatible&#034; content&#061;&#034;ie&#061;edge&#034;&gt;<br \/>\n    &lt;title&gt;\u7528\u6237\u767b\u5f55\u9996\u9875&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<br \/>\n    \u767b\u5f55\u4eba: &lt;span id&#061;&#034;loginUser&#034;&gt;&lt;\/span&gt;<\/p>\n<p>    &lt;script src&#061;&#034;https:\/\/cdn.bootcdn.net\/ajax\/libs\/jquery\/3.6.4\/jquery.min.js&#034;&gt;&lt;\/script&gt;<br \/>\n    &lt;script&gt;<br \/>\n        $.ajax({<br \/>\n            url:&#034;\/user\/getLoginUser&#034;,\/\/\u56e0\u4e3a\u662f\u4e2a\u5bf9\u8c61&#xff0c;\u6240\u4ee5\u6ca1\u987a\u5e8f<br \/>\n            type:&#034;get&#034;,<br \/>\n            \/\/\u6ca1\u6709\u4f20\u53c2&#xff0c;\u4e0d\u5199 data<br \/>\n            success:function(userName){<br \/>\n                $(&#034;#loginUser&#034;).text(userName);\/\/span\u6807\u7b7e\u4f7f\u7528text\u65b9\u5f0f\u6765\u8d4b\u503c<br \/>\n            }<br \/>\n        });<br \/>\n    &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt; <\/p>\n<h4 id=\"3.2.5%20%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95\">3.2.5 \u8fd0\u884c\u6d4b\u8bd5<\/h4>\n<p>\u81ea\u6d4b\u6f14\u793a&#x1f447;<\/p>\n<p>\u7528\u6237\u767b\u5f55\u9875\u9762\u524d\u540e\u7aef\u4ea4\u4e92\u6f14\u793a<\/p>\n<p>\u4ece\u4e0a\u8ff0\u89c6\u9891\u4e2d\u6211\u4eec\u53d1\u73b0&#xff0c;\u5f53\u6ca1\u6709\u767b\u5f55\u7684\u65f6\u5019&#xff0c;\u767b\u5f55\u4eba\u662f\u4e0d\u663e\u793a\u7684&#xff0c;\u8d26\u53f7\u548c\u5bc6\u7801\u5168\u6b63\u786e\u4e86\u624d\u80fd\u767b\u5f55\u6210\u529f~~<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5982\u679c\u4e00\u76f4\u8f6c\u5708\u5708&#xff0c;\u53ef\u80fd\u662f JQuery \u8fd8\u5728\u52a0\u8f7d&#xff0c;\u8fd9\u65f6\u5019\u53ef\u4ee5\u628a JQuery \u8bbe\u7f6e\u6210\u672c\u5730\u7684&#xff0c;\u5426\u5219\u540e\u7eed\u7684\u4ee3\u7801\u90fd\u9700\u8981 JQuery&#xff0c;\u662f\u8fd0\u884c\u4e0d\u8d77\u6765\u7684&#xff0c;\u800c\u4e14\u5176\u5b9e\u5728 \u6d4f\u89c8\u5668 \u4e2d\u6211\u4eec\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u7b80\u5355\u6293\u5305&#x1f447;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"988\" src=\"2026-10-31134wn3u4uh3.png\" width=\"1917\" \/><\/p>\n<p>\u6309\u4e0b F12 \u540e&#xff0c;\u5728\u7f51\u7edc\u90e8\u5206&#xff0c;\u5de6\u8fb9\u5c31\u662f\u8bbf\u95ee\u7684\u4e00\u4e9b\u4e1c\u897f&#xff0c;\u53f3\u8fb9\u5c31\u662f Header \u4e4b\u7c7b\u7684~~<\/p>\n<p>\u90a3\u5982\u679c\u6211\u4eec\u767b\u5f55\u4e4b\u540e\u628a Session \u6539\u4e00\u4e0b&#x1f447;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"238\" src=\"2026-10-31zidw1bbolu2.png\" width=\"1917\" \/><\/p>\n<p>\u6211\u4eec\u628a\u5f00\u5934\u7684 4 \u6539\u6210 3 \u518d\u6765\u770b\u4e00\u4e0b&#x1f447;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"282\" src=\"2026-10-31eg5rg4xodla.png\" width=\"1917\" \/><\/p>\n<p>\u5237\u65b0\u540e\u5c31\u53d1\u73b0\u627e\u4e0d\u5230\u4e86&#x1f447;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"233\" src=\"2026-10-31mg2f2ttj0wk.png\" width=\"1917\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n3.\u7efc\u5408\u6027\u7ec3\u4e60<br \/>\n3.1 \u52a0\u6cd5\u8ba1\u7b97\u5668<br \/>\n3.1.1 \u51c6\u5907\u5de5\u4f5c<br \/>\n3.1.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3<br \/>\n\u6982\u5ff5\u4ecb\u7ecd<br \/>\n\u9700\u6c42\u5206\u6790<br \/>\n\u63a5\u53e3\u5b9a\u4e49<br \/>\n\u8bf7\u6c42\u53c2\u6570<br \/>\n\u54cd\u5e94\u6570\u636e<br \/>\n3.1.3 \u670d\u52a1\u5668\u4ee3\u7801<br \/>\n3.1.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801<br \/>\n3.1.5 \u8fd0\u884c\u6d4b\u8bd5<br \/>\n3.2 \u7528\u6237\u767b\u5f55<br \/>\n3.2.1 \u51c6\u5907\u5de5\u4f5c<br \/>\n3.2.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3<br \/>\n\u9700\u6c42\u5206\u6790<br \/>\n\u63a5\u53e3\u5b9a\u4e49<br \/>\n\u6821\u9a8c\u63a5\u53e3<br \/>\n\u8bf7\u6c42\u53c2\u6570<br \/>\n\u54cd\u5e94\u6570\u636e<br \/>\n\u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3<br \/>\n\u8bf7\u6c42\u53c2\u6570<br \/>\n\u54cd\u5e94\u6570\u636e<br \/>\n3.2.3 \u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u4ee3\u7801<br \/>\n\u6821\u9a8c\u63a5\u53e3<br \/>\n\u67e5\u8be2\u767b<\/p>\n","protected":false},"author":2,"featured_media":120612,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,374,101,87,176],"topic":[],"class_list":["post-120632","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-java-ee","tag-spring","tag-87","tag-176"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09 - \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\/120632.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 3.\u7efc\u5408\u6027\u7ec3\u4e60 3.1 \u52a0\u6cd5\u8ba1\u7b97\u5668 3.1.1 \u51c6\u5907\u5de5\u4f5c 3.1.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3 \u6982\u5ff5\u4ecb\u7ecd \u9700\u6c42\u5206\u6790 \u63a5\u53e3\u5b9a\u4e49 \u8bf7\u6c42\u53c2\u6570 \u54cd\u5e94\u6570\u636e 3.1.3 \u670d\u52a1\u5668\u4ee3\u7801 3.1.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801 3.1.5 \u8fd0\u884c\u6d4b\u8bd5 3.2 \u7528\u6237\u767b\u5f55 3.2.1 \u51c6\u5907\u5de5\u4f5c 3.2.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3 \u9700\u6c42\u5206\u6790 \u63a5\u53e3\u5b9a\u4e49 \u6821\u9a8c\u63a5\u53e3 \u8bf7\u6c42\u53c2\u6570 \u54cd\u5e94\u6570\u636e \u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3 \u8bf7\u6c42\u53c2\u6570 \u54cd\u5e94\u6570\u636e 3.2.3 \u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u4ee3\u7801 \u6821\u9a8c\u63a5\u53e3 \u67e5\u8be2\u767b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/120632.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-31T15:47:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154735-6ae60d973089c.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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/120632.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/120632.html\",\"name\":\"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-31T15:47:42+00:00\",\"dateModified\":\"2026-10-31T15:47:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/120632.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/120632.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/120632.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09\"}]},{\"@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":"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09 - \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\/120632.html","og_locale":"zh_CN","og_type":"article","og_title":"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 3.\u7efc\u5408\u6027\u7ec3\u4e60 3.1 \u52a0\u6cd5\u8ba1\u7b97\u5668 3.1.1 \u51c6\u5907\u5de5\u4f5c 3.1.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3 \u6982\u5ff5\u4ecb\u7ecd \u9700\u6c42\u5206\u6790 \u63a5\u53e3\u5b9a\u4e49 \u8bf7\u6c42\u53c2\u6570 \u54cd\u5e94\u6570\u636e 3.1.3 \u670d\u52a1\u5668\u4ee3\u7801 3.1.4 \u8c03\u6574\u524d\u7aef\u9875\u9762\u4ee3\u7801 3.1.5 \u8fd0\u884c\u6d4b\u8bd5 3.2 \u7528\u6237\u767b\u5f55 3.2.1 \u51c6\u5907\u5de5\u4f5c 3.2.2 \u7ea6\u5b9a\u524d\u540e\u7aef\u4ea4\u4e92\u63a5\u53e3 \u9700\u6c42\u5206\u6790 \u63a5\u53e3\u5b9a\u4e49 \u6821\u9a8c\u63a5\u53e3 \u8bf7\u6c42\u53c2\u6570 \u54cd\u5e94\u6570\u636e \u67e5\u8be2\u767b\u5f55\u7528\u6237\u63a5\u53e3 \u8bf7\u6c42\u53c2\u6570 \u54cd\u5e94\u6570\u636e 3.2.3 \u5b9e\u73b0\u670d\u52a1\u5668\u7aef\u4ee3\u7801 \u6821\u9a8c\u63a5\u53e3 \u67e5\u8be2\u767b","og_url":"https:\/\/www.wsisp.com\/helps\/120632.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-31T15:47:42+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261031154735-6ae60d973089c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/120632.html","url":"https:\/\/www.wsisp.com\/helps\/120632.html","name":"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-31T15:47:42+00:00","dateModified":"2026-10-31T15:47:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/120632.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/120632.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/120632.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java EE \u8fdb\u9636\uff1a4.Spring Web MVC \u5165\u95e8\uff08\u7b2c\u56db\u5f39\uff09"}]},{"@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\/120632","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=120632"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/120632\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/120612"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=120632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=120632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=120632"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=120632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}