單項(xiàng)選擇題在Spring Boot應(yīng)用中,以下哪個注解用于表示一個RESTful的Controller?()

A.@Controller
B.@RestController
C.@Service
D.@Repository


您可能感興趣的試卷

你可能感興趣的試題

1.單項(xiàng)選擇題在Spring Boot應(yīng)用中,如何配置應(yīng)用名稱?()

A.在application.properties中設(shè)置server.name
B.在application.properties中設(shè)置spring.application.name
C.在application.yml中設(shè)置name
D.在application.yml中設(shè)置spring.name

2.單項(xiàng)選擇題在Spring Boot應(yīng)用中,如果需要在啟動時運(yùn)行一些代碼,應(yīng)該使用哪種方式?()

A.使用@PostConstruct注解在Bean中
B.實(shí)現(xiàn)CommandLineRunner接口
C.實(shí)現(xiàn)ApplicationRunner接口
D.A和B都可以