修饰类:@RequestMapping("/home1")// 修饰类
@Controller
public class Home {
/**
* 路径 : home1/show1
*/
@RequestMapping("/show1")
public String showPage(HttpServletRequest request){
System.out.println("接收到页面请求");
return "home_index";
}
}
指定接收的请求方式,如get、post:/**
* 指定接收的请求方式,如get、post
* @return
*/
@RequestMapping(value="/testMethod",method=RequestMethod.POST)
public String testMethod(){
return "home_index";
}
限制请求参数,请求头:/**
* 限制请求参数,请求头
* url : home1/testParamsAndHeaders?id=123&age=26
* @return
*/
@RequestMapping(
value="/testParamsAndHeaders",
pa