我有一个web服务接受包含点表示法的@PathVariable
字符串属性。对于例如remote.output.location
,remote.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);
}