To bind the method return value as the response body in Spring Boot, you can use the _____ annotation.
- @GetMapping
- @RequestMapping
- @ResponseBody
- @ResponseEntity
In Spring Boot, to bind the method return value as the response body, you can use the @ResponseBody annotation. This annotation indicates that the return value of the method should be converted to JSON or another format and included in the HTTP response body. It's commonly used when you want to return data from a controller method in a RESTful web service.
Loading...
Related Quiz
- For custom authentication logic in Spring Security, developers can create a bean of type _____.
- In Spring, the _____ annotation is used to indicate that a method should be invoked after the bean has been constructed and injected.
- In Spring Boot, to order the execution of validation groups, the _____ interface needs to be implemented along with defining a sequence list of groups.
- What is the significance of the @MockBean annotation in Spring Boot testing?
- How can you enable transaction management in a Spring Boot application?