您的位置:首页 > 产品设计 > UI/UE

RequestMaping url带参数及参数带“."的解决办法

2015-11-05 18:59 477 查看
使用@PathVariable可以给url带参数,从而实现动态url的目的,如:

@RequestMapping(value = "/ping/{version}", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> test(@PathVariable String version, @RequestBody String body,
HttpServletRequest request, HttpServletResponse response) {
return null;
}


但如果version的值带".",则会被截断,将{version}修改为{version:.+}则可以完美解决。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: