SpringMVCDemo { @ResponseBody @RequestMapping(value = "/getNameByParam", method = RequestMethod.GET) public String getNameByParam(@RequestParam("name") String name) { return "SpringMVCDemo.getNameByParam:" + name; }  @ResponseBody @RequestMapping(value = "/getNameByParam", method = RequestMethod.GET) String getNameByParam(@RequestParam("name") String name); @ResponseBody @RequestMapping("/getNameByModel") String getNameByModel(@ModelAttribute("person") Student person); @ResponseBody @RequestMapping("/getNameByRequest") String getNameByRequest(HttpServletRequest request); @RequestMapping("/studentView") String studentView(ModelMap map); @RequestMapping("/redirect") String redirect(); @ResponseBody @RequestMapping("/getStudentByName") String getStudentByName(String name); @ResponseBody @RequestMapping(value = "/getRequest", method = RequestMethod.GET) String getRequest(); @ResponseBody @RequestMapping(value = "/downloadCsv", method = RequestMethod.GET) String downloadCsv(HttpServletResponse response);  }
@Test public void getNameByParam() { String name = "张三"; System.out.println(springMVCDemo.getNameByParam(name)); }