SpringMVC学习巩固(基本使用)(2)
@RequestMapping("路径"):
作用:将Handler注册到HandlerMapping(将方法进行一个注册)
annotation.RequestMappingHandlerMapping
路径格式:
1.单层路径: /直接写路径 eg: /test (精准路径)
2.多层路径: 路径1/路径2 eg: /test/test2 (精准路径)
3.模糊路径: /*:一层任意路径
/**:任意层任意路径
tips:可以在Controller类上添加@RequestMapping()注释,与具体方法的
@RequestMapping()中的路径进行组合,默认状态下可以接受get和post请求.
@RequestMapping(value={"路径1","路径2"},methed=RequestMethed.Post/Get)

关于Handler传入参数的方式说明:


浙公网安备 33010602011771号