@ResponseBody
params="json":访问我这个方法的时候一定要有参数名为json
返回值Userjackson-all-1.9.0.jar
@RequestMapping(value="/{nickname}",method=RequestMethod.GET,params="json") @ResponseBody public User show(@PathVariable String nickname){ System.out.println(nickname); return users.get(nickname); }
http://localhost:7070/SSM/user/lisi?json
时间: 2024-09-30 03:43:14