我遇到了控制器中的一個方法。這是什麼ID:。+ ??在Spring MVC的requestmapping處理方法中,{id:。+}是什麼意思?
@RequestMapping(value="/index/{endpoint}/{type}/{id:.+}", method=RequestMethod.POST, consumes=kContentType, produces=kProducesType)
@ResponseBody
public String indexData(@PathVariable(value="endpoint") String endpoint, @PathVariable(value="type") String type, @PathVariable(value="id") String id, @RequestBody String body, HttpServletRequest request) {
logger.debug("In web controller for endpoint " + endpoint);
return indexController.indexData(endpoint, type, id, body, getSecurityContextProvider(request));
}
你能提供一個可以用來打這個服務的url的例子? –
「/index/foo/bar/foo.bar」將起作用。如果沒有id路徑變量的「。+」正則表達式,你只會得到「foo」的id,而不是「foo.bar」 – reblace
我不太確定我跟着你reburs –