标签:
method:
@Controller
@RequestMapping("/test")
public String MyController{
@RequestMapping("/begin")
public String hi(HttpServletRequest request){
String name=request.getParameter("name");
System.out.println(name);
return "MyJsp";
url:"http://asus5-pc:8080/springMvc/test/begin?=zhan"
控制台输出:
zhan
restful风格:
method:
@Controller
@RequestMapping("/test")
public String MyController{
@RequestMapping("/begin/{name}")
public String hi(@PathVariable("name") String name){
System.out.println(name);
return "MyJsp";
url:"http://asus5-pc:8080/springMvc/test/begin/zhan.do"
控制台输出:
zhan
标签:
原文地址:http://www.cnblogs.com/lindaZ/p/4346915.html