L
A D I N G

SpringMvc注解@PathVariable

 

用法:

        @RequestMapping("/test/{id}/{name}")         //返回JSON数据 		@ResponseBody 		public String t1(@PathVariable("id")Integer ids, 				@PathVariable("name")String names) { 			return ids+names; 		}

请求的{ }必须和@PathVariable中的value值相同如果ids为id则可以省略value

@RequestMapping("/test/{id}/{name}") @ResponseBody public String t1(@PathVariable Integer id,@PathVariable String name) { 			return id+name; 		}