Guest
Guest

Reputation: 7

Add optional parameters in @modelattribute in spring mvc

I am working on spring mvc and I want to make some parameters in modelattribute as optional. Ex. We can use @RequestMapping to set optional parameters by required=false. So I need something like this in @modelattribute. I don't want to use RequestParam because I have big list of parameters. Is there any other way ?

Upvotes: 0

Views: 1799

Answers (1)

Eshan I.
Eshan I.

Reputation: 75

Feel free to use ModelAttribute as the values will be populated by default values like 0 for integer, More info can be found here

Upvotes: 0

Related Questions