HttpRequestServlet 接收前台传值
[java] view plain copy
@RequestMapping("/go5")
public String hello5(HttpServletRequest request){
String name=request.getParameter("uname");
String id=request.getParameter("uid");
System.out.println(id+"----"+name);
return "/WEB-INF/jsp/index.jsp";
}
直接接收前台传值
[java] view plain copy
//接收单个参数
@RequestMapping("/hello")
public String hello(String name){
System.out.println(name);
return "/WEB-INF/jsp/index.jsp";
}