CuriousMind
CuriousMind

Reputation: 8953

Meaning of "params" in @RequestMapping annotation?

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?

Upvotes: 13

Views: 17390

Answers (1)

Codo
Codo

Reputation: 79033

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

Upvotes: 17

Related Questions