Close

Spring MVC - @RequestMapping Variants Examples

Spring MVC 

Spring 4.3 new composed @RequestMapping variants annotations.

@Controller
public class MyController {

@GetMapping("test")
public String handleGetRequest () {

return "GetMapping-view";
}

@PostMapping("test")
public String handlePostRequest () {

return "PostMapping-view";
}

@PutMapping("test")
public String handlePutRequest () {

return "PutMapping-view";
}

@DeleteMapping("test")
public String handleDeleteRequest () {

return "DeleteMapping-view";
}

@PatchMapping("test")
public String handlePatchRequest () {

return "PatchMapping-view";
}

}
Original Post




See Also