@ModelAttribute: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Spring MVC Concepts =Overview= <syntaxhighlight lang='java'> public class ...Controller { @ModelAttribute(n...")
 
Line 4: Line 4:


=Overview=
=Overview=
@ModelAttribute ensures that the corresponding object will be created in the [[Spring MVC Concepts#Model|model]].


<syntaxhighlight lang='java'>
<syntaxhighlight lang='java'>

Revision as of 23:53, 14 October 2018

Internal

Overview

@ModelAttribute ensures that the corresponding object will be created in the model.

public class ...Controller {

    @ModelAttribute(name = "something")
    public Something something() {
        return new Something();
    }