Which of the following annotations is used to map a web request to a specific handler method?

  • @RequestMapping
  • @ResponseBody
  • @PostMapping
  • @Autowired
The @RequestMapping annotation is used to map a web request to a specific handler method in a Spring Boot controller. It allows you to specify the URL path, HTTP method, and other parameters to define how the request should be routed to the appropriate method. The other options, such as @ResponseBody, @PostMapping, and @Autowired, serve different purposes in Spring Boot but are not used for request mapping.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *