@PathVariable带有点表示法属性的字符串无法正常工作

时间:2014-09-30 15:36:24

标签: java rest

我有一个web服务接受包含点表示法的@PathVariable字符串属性。对于例如remote.output.locationremote.output.templocation等 出于某种原因,当我从浏览器发送上述属性时,webservice只解释前两个单词 - 即两个属性的remote.output

但是,请求参数工作正常。 /webservice/prop?key=remote.output.location

使用@PathVariable: /webservice/prop/remote.output.location - 这不起作用

@RequestMapping(value = "/prop/{key}", method = RequestMethod.GET)
public @ResponseBody String getPropertyValue(ModelMap model, @PathVariable("key") String key ) {        
    log.info("getPropertyValue() /prop/key :"+key);         
    return config.getProperty(key);
}

0 个答案:

没有答案