springmvc注解开发之requestMapping

xiaoxiao2021-02-28  123

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

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

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

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

4.限制必须有某些参数

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

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

转载请注明原文地址: https://www.6miu.com/read-51889.html

最新回复(0)