In Spring Boot, to create a RESTful web service, you would typically use the _____ annotation on a controller class.
- @Controller
- @RequestMapping
- @RequestMapping and @RestController
- @RestController
In Spring Boot, to create a RESTful web service, you typically use the @RestController annotation on a controller class. This annotation combines the functionality of both the @Controller and @ResponseBody annotations, making it convenient for creating RESTful endpoints that return data directly in the response body, without the need for a view.
Loading...
Related Quiz
- How can you handle different HTTP methods in a single method in a Spring Boot controller?
- Which component in Spring Security is responsible for evaluating method security annotations like @Secured and @PreAuthorize?
- In Spring Boot, the _____ can be optimized to efficiently manage database connections and improve application performance.
- Which of the following is true about the deleteById method of a JpaRepository?
- For creating custom auto-configuration in Spring Boot, the configuration class needs to be listed in the _____ file.