What is @RestController annotation in Spring Boot?

Category: Spring BootWhat is @RestController annotation in Spring Boot?
Editor">Editor Staff asked 2 years ago

What is @RestController annotation in Spring Boot?

1 Answers
Editor">Editor Staff answered 2 years 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.