{"id":548,"date":"2022-07-04T15:25:43","date_gmt":"2022-07-04T07:25:43","guid":{"rendered":"http:\/\/blog.nonot.cn\/?p=548"},"modified":"2024-07-08T12:47:26","modified_gmt":"2024-07-08T04:47:26","slug":"java%e4%b8%ad%e8%8e%b7%e5%8f%96%e5%ae%8c%e6%95%b4%e7%9a%84url","status":"publish","type":"post","link":"https:\/\/blog.nonot.cn\/index.php\/2022\/07\/04\/java%e4%b8%ad%e8%8e%b7%e5%8f%96%e5%ae%8c%e6%95%b4%e7%9a%84url\/","title":{"rendered":"Java\u4e2d\u83b7\u53d6\u5b8c\u6574\u7684url"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5148\u5728\u9875\u9762\u4e0a\u83b7\u53d6HttpServletRequest\u5bf9\u8c61<\/p>\n\n\n<p>String url = &#8220;http:\/\/&#8221; + request.getServerName() \/\/\u670d\u52a1\u5668\u5730\u5740 <br \/>+ &#8220;:&#8221; <br \/>+ request.getServerPort() \/\/\u7aef\u53e3\u53f7 <br \/>+ request.getContextPath() \/\/\u9879\u76ee\u540d\u79f0 <br \/>+ request.getServletPath() \/\/\u8bf7\u6c42\u9875\u9762\u6216\u5176\u4ed6\u5730\u5740 <br \/>+ &#8220;?&#8221; + (request.getQueryString()); \/\/\u53c2\u6570<\/p>","protected":false},"excerpt":{"rendered":"<p>\u5148\u5728\u9875\u9762\u4e0a\u83b7\u53d6HttpServletRequest\u5bf9\u8c61 St&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-548","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/comments?post=548"}],"version-history":[{"count":1,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":1191,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/548\/revisions\/1191"}],"wp:attachment":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/media?parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/categories?post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/tags?post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}