springmvc使用restful怎么传递到后台
1个回答
2016-11-30 · 知道合伙人软件行家
关注
展开全部
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";
}
[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";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询