@RequestMapping(value = "/sendSignal/{state}/{limberId}/{account}", method = RequestMethod.GET) @ResponseBody public Map <String, Object> signal (athPathVariable int state, athPathVariable String limberId, athPathVariable String account) System.out.println("参数:"+state+"/"+limberId+"/"+account); Map<String, Object> map = new HashMap<String, Object>(); return map; }
When there are multiple parameters, the @PathVariable annotation needs to be added before each variable, otherwise the parameters passed to the method are empty;
There is a one-to-one correspondence between variable names and locations.