Spring Boot - REST Controllers
Which of the following is the correct way to declare a REST controller class in Spring Boot?
@RestController.@GetMapping and return a response body.@RestController
public class MyController {
@GetMapping("/test")
public String test() {
return "OK";
}
} correctly declares a REST controller with proper mapping and return type.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions