What is @RestController annotation in Spring Boot?

DWQA QuestionsCategory: Spring BootWhat is @RestController annotation in Spring Boot?
Editor Staff asked 9 months ago

What is @RestController annotation in Spring Boot?

1 Answers
Editor Staff answered 9 months ago

The @RestController is a stereotype annotation. It adds @Controller and @ResponseBody annotations to the class. We need to import org.springframework.web.bind.annotation package in our file, in order to implement it.