1.servlet
@GetMapping("/params") public String test5(HttpServletRequest request){ String username = request.getParameter("username"); String password = request.getParameter("password"); System.out.println(username + " " + password); return "test6"; }
2 通过控制器形参获取参数
@GetMapping("/params2") public String test6(String username,String password){ System.out.println(username + " " + password); return "test6"; }
标签:username,String,test6,springMVC,request,System,获取,参数,password From: https://www.cnblogs.com/cciscc/p/16656551.html