事情发生经过是我有次springboot项目中定义了一个遵循restful规则的接口,

@RequestMapping(value = "/xxxx/{email}", method = RequestMethod.GET)
public void xxxtest(@PathVariable String email) {
    System.out.println(email);
}

 

这时候访问的时候http://localhst:8080/xxxx/tets@qq.com

输出的email变成了qq

请求url被“ . “截断了。最终得到的额email的值是qq,而不是qq.com

 

这里要说道一个类,PatternsRequestCondition

里面有两个匹配规则,

 

useSuffixPatternMatch:设置是否是后缀模式匹配,如“/user”是否匹配/user.*,默认真即匹配;

这种模式下.后面加任何后缀,都会被匹配到。user.do,user.html

 

useTrailingSlashMatch:设置是否自动后缀路径模式匹配,如“/user”是否匹配“/user/”,默认真即匹配;

 

private String getMatchingPattern(String pattern, String lookupPath) {
   if (pattern.equals(lookupPath)) {
      return pattern;
   }
   if (this.useSuffixPatternMatch) {
      if (!this.fileExtensions.isEmpty() && lookupPath.indexOf('.') != -1) {
         for (String extension : this.fileExtensions) {
            if (this.pathMatcher.match(pattern + extension, lookupPath)) {
               return pattern + extension;
            }
         }
      }
      else {
         boolean hasSuffix = pattern.indexOf('.') != -1;
         if (!hasSuffix && this.pathMatcher.match(pattern + ".*", lookupPath)) {
            return pattern + ".*";
         }
      }
   }
   if (this.pathMatcher.match(pattern, lookupPath)) {
      return pattern;
   }
   if (this.useTrailingSlashMatch) {
      if (!pattern.endsWith("/") && this.pathMatcher.match(pattern + "/", lookupPath)) {
         return pattern +"/";
      }
   }
   return null;
}

 

 

默认情况下启动程序,这两个值都是默认true,可以通过在主程序入库

public class xxxApplication extends WebMvcConfigurationSupport {

    @Override
    protected void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setUseSuffixPatternMatch(false);
    }

 

通过重写configurePathMatch方法,设置useSuffixPatternMatchuseTrailingSlashMatch的值来达到修改规则的目的

1,105 对 “Springboot中URL的匹配规则”的想法;

  1. What i do not realize is in reality how you are no longer really much more neatly-preferred than you might be right now. You are so intelligent. You recognize therefore significantly in relation to this matter, produced me in my view consider it from so many various angles. Its like men and women are not interested unless it’s one thing to do with Woman gaga! Your own stuffs excellent. Always maintain it up!

  2. What i do not realize is in reality how you are no longer really much more neatly-preferred than you might be right now. You are so intelligent. You recognize therefore significantly in relation to this matter, produced me in my view consider it from so many various angles. Its like men and women are not interested unless it’s one thing to do with Woman gaga! Your own stuffs excellent. Always maintain it up!

  3. What i don’t understood is actually how you’re now not really much more well-favored than you may be now. You’re very intelligent. You realize therefore considerably when it comes to this subject, produced me for my part imagine it from so many various angles. Its like men and women are not involved unless it is one thing to do with Girl gaga! Your individual stuffs great. Always handle it up!

  4. What i don’t realize is actually how you are not actually much more well-liked than you may be now. You’re so intelligent. You realize therefore considerably relating to this subject, made me personally consider it from numerous varied angles. Its like women and men aren’t fascinated unless it is one thing to accomplish with Lady gaga! Your own stuffs outstanding. Always maintain it up!

  5. What i do not realize is if truth be told how you’re no longer actually a lot more smartly-liked than you may be right now. You are very intelligent. You realize therefore considerably relating to this matter, made me for my part believe it from so many various angles. Its like men and women aren’t fascinated until it is something to do with Girl gaga! Your personal stuffs outstanding. Always maintain it up!

  6. What i don’t understood is actually how you’re now not really much more well-favored than you may be now. You’re very intelligent. You realize therefore considerably when it comes to this subject, produced me for my part imagine it from so many various angles. Its like men and women are not involved unless it is one thing to do with Girl gaga! Your individual stuffs great. Always handle it up!

  7. What i don’t understood is actually how you’re now not really much more well-favored than you may be now. You’re very intelligent. You realize therefore considerably when it comes to this subject, produced me for my part imagine it from so many various angles. Its like men and women are not involved unless it is one thing to do with Girl gaga! Your individual stuffs great. Always handle it up!

  8. What i do not understood is in reality how you are not really a lot more well-preferred than you might be right now. You are very intelligent. You understand thus significantly on the subject of this subject, produced me in my opinion believe it from a lot of varied angles. Its like women and men aren’t involved unless it’s something to accomplish with Lady gaga! Your individual stuffs great. All the time handle it up!

  9. When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get four emails with the same comment. Perhaps there is a way you are able to remove me from that service? Appreciate it!

  10. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  11. When I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the same comment. Is there any manner you can remove me from that service? Thanks!

  12. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the exact same comment. Is there a means you can remove me from that service? Cheers!

  13. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  14. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  15. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  16. When I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Many thanks!

  17. When I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the same comment. Is there any manner you can remove me from that service? Thanks!

  18. Whats up very cool site!! Guy .. Excellent .. Wonderful .. I will bookmark your blog and take the feeds additionally…I’m satisfied to search out so many helpful information right here within the publish, we want develop extra strategies on this regard, thanks for sharing.

  19. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  20. When you are ready doing everything we have talked about in the previous paragraphs, which is considering your shopping list with careful planning accuracy, finding the drugs you require remember that we have a great number of sildenafil pills, which are generic Viagra tablets in their different editions, forms and dosages and sending them to the shopping cart, you will be redirected to the page with your personal details.

  21. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  22. While they don t keep the same type of statistics for sex as they do for major league baseball otherwise you may not want to see your batting average or on-base percentage , one has to wonder how using such sex PEDs may have altered the perceptions, dynamics, psychology, emotional aspects, and health of sex.

  23. When I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Many thanks!

  24. When you are ready doing everything we have talked about in the previous paragraphs, which is considering your shopping list with careful planning accuracy, finding the drugs you require remember that we have a great number of sildenafil pills, which are generic Viagra tablets in their different editions, forms and dosages and sending them to the shopping cart, you will be redirected to the page with your personal details.

  25. When I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the same comment. Is there any manner you can remove me from that service? Thanks!

  26. When you are ready doing everything we have talked about in the previous paragraphs, which is considering your shopping list with careful planning accuracy, finding the drugs you require remember that we have a great number of sildenafil pills, which are generic Viagra tablets in their different editions, forms and dosages and sending them to the shopping cart, you will be redirected to the page with your personal details.

  27. While they don t keep the same type of statistics for sex as they do for major league baseball otherwise you may not want to see your batting average or on-base percentage , one has to wonder how using such sex PEDs may have altered the perceptions, dynamics, psychology, emotional aspects, and health of sex.

  28. When you are ready doing everything we have talked about in the previous paragraphs, which is considering your shopping list with careful planning accuracy, finding the drugs you require remember that we have a great number of sildenafil pills, which are generic Viagra tablets in their different editions, forms and dosages and sending them to the shopping cart, you will be redirected to the page with your personal details.

  29. When I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Many thanks!

  30. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  31. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  32. While they don t keep the same type of statistics for sex as they do for major league baseball otherwise you may not want to see your batting average or on-base percentage , one has to wonder how using such sex PEDs may have altered the perceptions, dynamics, psychology, emotional aspects, and health of sex.

  33. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  34. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  35. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  36. While they don t keep the same type of statistics for sex as they do for major league baseball otherwise you may not want to see your batting average or on-base percentage , one has to wonder how using such sex PEDs may have altered the perceptions, dynamics, psychology, emotional aspects, and health of sex.

  37. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  38. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove people from that service? Cheers!

  39. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the exact same comment. Is there a means you can remove me from that service? Cheers!

  40. When I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the same comment. Is there any manner you can remove me from that service? Thanks!

  41. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  42. When I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Many thanks!

  43. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  44. When I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the exact same comment. Perhaps there is an easy method you can remove me from that service? Many thanks!

  45. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  46. What i don’t understood is in fact how you are not actually a lot more smartly-preferred than you may be now. You are very intelligent. You understand therefore considerably in terms of this topic, produced me in my view imagine it from a lot of various angles. Its like women and men aren’t involved unless it’s one thing to do with Girl gaga! Your personal stuffs excellent. All the time deal with it up!

  47. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  48. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  49. Whats up very cool site!! Guy .. Excellent .. Wonderful .. I will bookmark your blog and take the feeds additionally…I’m satisfied to search out so many helpful information right here within the publish, we want develop extra strategies on this regard, thanks for sharing.

  50. What i don’t understood is in fact how you are not actually a lot more smartly-preferred than you may be now. You are very intelligent. You understand therefore considerably in terms of this topic, produced me in my view imagine it from a lot of various angles. Its like women and men aren’t involved unless it’s one thing to do with Girl gaga! Your personal stuffs excellent. All the time deal with it up!

  51. Whats up very cool site!! Guy .. Excellent .. Wonderful .. I will bookmark your blog and take the feeds additionally…I’m satisfied to search out so many helpful information right here within the publish, we want develop extra strategies on this regard, thanks for sharing.

  52. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  53. When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get four emails with the same comment. Perhaps there is a way you are able to remove me from that service? Appreciate it!

  54. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  55. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  56. Whats up very cool site!! Guy .. Excellent .. Wonderful .. I will bookmark your blog and take the feeds additionally…I’m satisfied to search out so many helpful information right here within the publish, we want develop extra strategies on this regard, thanks for sharing.

  57. What i do not realize is if truth be told how you’re no longer actually a lot more smartly-liked than you may be right now. You are very intelligent. You realize therefore considerably relating to this matter, made me for my part believe it from so many various angles. Its like men and women aren’t fascinated until it is something to do with Girl gaga! Your personal stuffs outstanding. Always maintain it up!

  58. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove people from that service? Cheers!

  59. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  60. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  61. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  62. When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get four emails with the same comment. Perhaps there is a way you are able to remove me from that service? Appreciate it!

  63. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Thank you!

  64. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  65. What i do not understood is in reality how you are not really a lot more well-preferred than you might be right now. You are very intelligent. You understand thus significantly on the subject of this subject, produced me in my opinion believe it from a lot of varied angles. Its like women and men aren’t involved unless it’s something to accomplish with Lady gaga! Your individual stuffs great. All the time handle it up!

  66. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Many thanks!

  67. When I initially commented I clicked the -Notify me when new comments are added- checkbox and now every time a remark is added I get four emails with the same comment. Is there any manner you can remove me from that service? Thanks!

  68. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  69. When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get four emails with the same comment. Perhaps there is a way you are able to remove me from that service? Appreciate it!

  70. What i do not understood is in reality how you are not really a lot more well-preferred than you might be right now. You are very intelligent. You understand thus significantly on the subject of this subject, produced me in my opinion believe it from a lot of varied angles. Its like women and men aren’t involved unless it’s something to accomplish with Lady gaga! Your individual stuffs great. All the time handle it up!

  71. What i do not understood is in reality how you are not really a lot more well-preferred than you might be right now. You are very intelligent. You understand thus significantly on the subject of this subject, produced me in my opinion believe it from a lot of varied angles. Its like women and men aren’t involved unless it’s something to accomplish with Lady gaga! Your individual stuffs great. All the time handle it up!

  72. What i do not realize is in reality how you are no longer really much more neatly-preferred than you might be right now. You are so intelligent. You recognize therefore significantly in relation to this matter, produced me in my view consider it from so many various angles. Its like men and women are not interested unless it’s one thing to do with Woman gaga! Your own stuffs excellent. Always maintain it up!

  73. Whats up very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to find a lot of helpful info right here in the post, we need work out extra techniques in this regard, thank you for sharing.

  74. What i don’t realize is actually how you are no longer really a lot more smartly-liked than you might be now. You’re very intelligent. You already know therefore considerably when it comes to this topic, made me in my opinion imagine it from numerous numerous angles. Its like men and women are not fascinated unless it is one thing to accomplish with Lady gaga! Your individual stuffs nice. Always deal with it up!

  75. What i don’t understood is in fact how you are not actually a lot more smartly-preferred than you may be now. You are very intelligent. You understand therefore considerably in terms of this topic, produced me in my view imagine it from a lot of various angles. Its like women and men aren’t involved unless it’s one thing to do with Girl gaga! Your personal stuffs excellent. All the time deal with it up!