问题
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