SpringMvc注解:
1、@Controller
修饰类,定义一个控制器
2、@RequestMapping("URL")
1)修饰方法:web请求的url
2)修饰类:括号里相当于web应用的根目录
@RequestMapping除了可以使用请求URL映射请求外,还可以使用请求方法、请求参数和请求头映射请求。
@RequestMapping的value、method、params、heads分别表示请求url、请求方法、请求参数、请求头,他们之间是与的关系,联合使用可以使请求更加精确化。
例如:@RequestMapping(value="/testMehtod",method=RequestMethod.POST)
jsp页面:<form action="springmvc/testMehtod" method="post">
<input value="submit" type="submit"/>
</form>
3、@PathVariable