1
我有兩個方法,這是衝突曖昧的處理方法爲映射HTTP路徑
1. @RequestMapping(value = { "/{name}" }, method = RequestMethod.GET)
void foo1(@PathVariable("name") final String name)
2. @RequestMapping(value = { "/{email}" }, method = RequestMethod.GET)
void getTemplateVersionsBySenderForClient(@PathVariable("email") final String email,
@RequestParam(value = "timestamp", required = true) final long timestamp)
我如何避免這種情況?
作爲用戶,您如何區分這兩個映射?你最好提供語義上重要的URI(/ name/{name}和/ email/{email}) –