Which annotation is mainly used to handle HTTP GET requests in a Spring Boot application?
- @GetMapping
- @RequestMapping
- @RequestMethod.GET
- @HttpHandler.GET
The @GetMapping annotation is mainly used to handle HTTP GET requests in a Spring Boot application. It is a specialized annotation that maps HTTP GET requests to specific controller methods. While @RequestMapping is a more generic annotation used for various HTTP methods, @GetMapping specifically targets GET requests, making the code more readable and explicit. The other options are not valid Spring annotations.
Loading...
Related Quiz
- In a Spring Boot application, which utility is primarily used for performing HTTP requests in integration tests?
- What is the purpose of password encoding in Spring Security?
- You are tasked with developing a Spring Boot application where different validation rules need to be applied depending on the state of the object. How would you design the validation logic to accommodate this requirement?
- In a Spring Boot application, the _____ annotation allows the conditional caching of method return values based on the evaluation of a SpEL expression.
- How can you configure multiple data sources in a Spring Boot application?