springmvc注解开发之requestMapping

来源:互联网 发布:php写入mysql数据库 编辑:程序博客网 时间:2024/06/11 17:09

1.在Controller上注解添加根路径

根路径
则此时访问该controller的路径为 ip:端口号/项目名/product/xxx.action

2.在方法上加上url
methodUrl
url为 ip:端口号/项目名/product/findProList.action
(url建议与方法名一样)

3.限制请求方法(get/post)
get/post
该方法限制为get和post请求

4.限制必须有某些参数

@RequestMapping(value="/findProList",params="user=name")

限制处理请求中必须有user=name。

原创粉丝点击