Loading tutorials
@PathVariable, @RequestParam, and @RequestBody have something concrete to attach to.6 min read42 in /api/books/42. This chapter covers how @PathVariable binds that segment to a method parameter, and how to handle names, multiple variables, optional segments, patterns, and failures.6 min readspring-boot-starter-web), know what a controller method is, and understand HTTP methods and status codes. You should also be comfortable with Java records and basic generics.4 min read@GetMapping, and that you have seen @PathVariable and @RequestParam. You should also know that an exception thrown in a handler method becomes an HTTP error response.5 min readspring-boot-starter-web) that runs. You should also know basic JSON syntax and HTTP status codes. The previous chapter showed6 min read@RequestBody. It also assumes you know what a Java record is and what an HTTP 400 status means. The previous chapter showed how Jackson turns JSON into a record. Here you will make S6 min read@PathVariable and @RequestParam values and that you have seen Bean Validation on a request body with @Valid. It also assumes a Spring Boot 3.x project, Spring Framework 6.1 or later. The getParameterValidationResults() call used below needs Spring Fr5 min read@GetMapping and @RequestParam, you know Java records, and you have seen Bean Validation annotations such as @Min on a request body. It uses Spring Framework 6.x (Spring Boot 3.x).6 min read@PathVariable, @RequestParam, and @RequestBody annotations, and that you have used Bean Validation annotations such as @NotBlank and @Valid. 5 min read@PathVariable, @RequestParam, and @RequestBody parameters, and that you know HTTP methods and status codes. It is about design. Given a piece of input, which of the three channels should carry it? Spring will bind any of them, so the framework does not6 min readcurl, then write automated tests with MockMvc. It assumes you have the BookController, CreateBookRequest, and ApiExceptionHandler classes from the previous chapters. It also assu5 min read