I am new to spring mvc and have seen examples in which people use @ModelAttribute("form") Person personthe method parameter, and some only (Person person). what is the difference.
@ModelAttribute("form") Person person
(Person person)
Thanks in advance
@ModelAttributeallows you to specify the name of the model attribute. When a parameter does not have this annotation, a decapitalized class name is used as the attribute name, i.e. Person p→ "person".
@ModelAttribute
Person p
If you do not specify @ModelAttributein this situation, then Spring will cause the presence of one. In this case, it will output @ModelAttribute("person"). The argument is the name of the model.
@ModelAttribute("person")
, Person , @ModelAttribute .
Person
Source: https://habr.com/ru/post/1760088/More articles:Calling R on Linux - rHow to have a variable as a regular expression in Perl - regexProgrammatically determine DPI window settings? - c ++Perhaps pointer function or casting is a problem. Not sure - cHow to determine if iphone is disconnected - iphoneWeifenluo dock kit: floating windows using their design size? - c #OData - Simple Data Authentication - odataПриложение для совместного доступа к документам с MVC - phpmobile technologies asp.net - asp.netSOP problem behind reverse proxy - same-origin-policyAll Articles