记录/user/*/createUser 匹配 /user/aaa/createUseraaa 可以改成任意字符。PathVariable 可以映射url中的占位符到目标方法的参数中RequestMapping(/test/{id}) public String test(pathVariable(id) Integer id){ System.out.println(id); return ; }