springmvc 参数 代码_无分析
@Controller public class HiController { //1. url上获取参数 @RequestMapping("/variable/{id}") @ResponseBody public String getVariables(@PathVariable(value="id") String myId) { return myId; } //2. 参数名字不一致用@RequestParam @RequestMapping("name") @ResponseBody public String getParam(@RequestParam("name") String myName) { return myName; } }
1:
2: