@PostMapping: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
=Overview=
=Overview=


Designates a controller handler method to handle POST requests.
Designates a controller handler method to handle POST requests. The content of the HTML form posted is presented to the method as a domain model data object. In the example below, the form is used to build a taco composition:
 
<syntaxhighlight lang='java'>
@PostMapping
public String processFormContent(Taco taco) {
 
        // ...
 
        return "redirect:/orders/current";
    }
</syntaxhighlight>

Revision as of 04:11, 12 October 2018

Internal

Overview

Designates a controller handler method to handle POST requests. The content of the HTML form posted is presented to the method as a domain model data object. In the example below, the form is used to build a taco composition:

@PostMapping
public String processFormContent(Taco taco) {

        // ...

        return "redirect:/orders/current";
    }