Reputation: 3432
I need to pass many request params to @Controller
.
So I want all these params to be wrapped into object which is provided as argument of @Controller
by spring mvc.
I also want to use @Valid
annotation on this argument.
This is the same as @RequestBody
with POST http method.
But I need object like @RequestBody
with GET http method.
How to put all request params into single object which is provided as argument in @Controller
method?
Upvotes: 0
Views: 44
Reputation: 4114
You can use @RequestBody
as well, but you also have @ModelAttribute
annotation to map parameters into a bean's properties.
Upvotes: 1