{"id":227777,"date":"2021-10-12T09:47:09","date_gmt":"2021-10-12T01:47:09","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=227777"},"modified":"2021-09-30T09:49:22","modified_gmt":"2021-09-30T01:49:22","slug":"spring-boot-url","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/spring-boot-url.html","title":{"rendered":"spring boot\u8bf7\u6c42\u540e\u7f00\u5339\u914d\u7684\u64cd\u4f5c"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86spring boot \u8bf7\u6c42\u540e\u7f00\u5339\u914d\u7684\u64cd\u4f5c\uff0c\u5177\u6709\u5f88\u597d\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002\u5982\u6709\u9519\u8bef\u6216\u672a\u8003\u8651\u5b8c\u5168\u7684\u5730\u65b9\uff0c\u671b\u4e0d\u541d\u8d50\u6559<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n spring boot \u8bf7\u6c42\u540e\u7f00\u5339\u914d<\/strong><\/div>\n spring boot \u9879\u76ee\u4e2d\u6dfb\u52a0\u8fd9\u4e2a\u7c7b<\/strong><\/span><\/div>\n \u53ef\u4ee5\u5b9e\u73b0url\u4e0d\u540c\u540e\u7f00\u533a\u5206\u4e86<\/p>\n \r\npublic class UrlMatchConfig extends WebMvcConfigurationSupport {\r\n @Override\r\n public void configurePathMatch(PathMatchConfigurer configurer) {\r\n \/\/setUseSuffixPatternMatch \u540e\u7f00\u6a21\u5f0f\u5339\u914d\r\n configurer.setUseSuffixPatternMatch(true);\r\n \/\/setUseTrailingSlashMatch \u81ea\u52a8\u540e\u7f00\u8def\u5f84\u6a21\u5f0f\u5339\u914d\r\n configurer.setUseTrailingSlashMatch(true);\r\n }\r\n}\r\n<\/pre>\n |