zhihuifan

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 有两种解决方案:

1:在api路径中加入:.+

1 @RequestMapping("/findByIp/{ip:.+}")
2    public Object test(@PathVariable String ip) {
3        System.out.println(ip);
4        return "";
5   }

但这种方式在web服务中感觉太过于鸡肋

 

所以在springMvc.xml中配置mvc标签

2.<mvc:path-matching registered-suffixes-only="true"/>

1 <mvc:annotation-driven >
2     <mvc:path-matching registered-suffixes-only="true"/>
3 </mvc:annotation-driven>

 

 

原文链接:

https://blog.csdn.net/weixin_42599091/article/details/82666646

 

声明:此博客为个人学习之用,如与其他作品雷同,纯属巧合,转载请指明出处!

posted on 2019-11-29 17:33  Hi,ZHF  阅读(432)  评论(0)    收藏  举报