@DeleteMapping: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Spring MVC Concepts =Overview=") |
(→REST) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[ | * [[Spring MVC Concepts#.40DeleteMapping|Spring MVC Concepts]] | ||
=Overview= | =Overview= | ||
The annotation may also contain a sub-path relative to the class-level base path, usually configured with [[@RequestMapping]]. | |||
=REST= | |||
<syntaxhighlight lang='java'> | |||
@RestController | |||
@RequestMapping(path = "/a", produces = "application/json") | |||
public class AController { | |||
@DeleteMapping(path = "/{id}") | |||
@ResponseStatus(code = HttpStatus.NO_CONTENT) | |||
public void delete(@PathVariable("id") Integer id) { | |||
content.remove(id); | |||
} | |||
} | |||
</syntaxhighlight> | |||
=HTTP DELETE Semantics for REST Applications= | |||
{{Internal|REST_and_Hypermedia#DELETE|HTTP DELETE Semantics for REST Applications}} |
Latest revision as of 03:14, 13 March 2019
Internal
Overview
The annotation may also contain a sub-path relative to the class-level base path, usually configured with @RequestMapping.
REST
@RestController
@RequestMapping(path = "/a", produces = "application/json")
public class AController {
@DeleteMapping(path = "/{id}")
@ResponseStatus(code = HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") Integer id) {
content.remove(id);
}
}