Meaning of “params” in @RequestMapping annotation?

谁都会走 提交于 2019-12-10 03:52:12

问题


I am aware of @RequestMapping annotation which is used in Spring MVC based application.

I came across this piece of code:

@RequestMapping(method = POST, params = {"someParam"})

I understood the method. However I don't know what params means? Before this I never had seen anything which passed params to this annotation.

Can anyone help in understanding this?


回答1:


Your example means that the parameter someParam must be present in the request. This is used to narrow down the matching methods for the given request.

See the documentation: RequestMapping#params



来源:https://stackoverflow.com/questions/39102731/meaning-of-params-in-requestmapping-annotation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!