JavaGuidePro.com
Toggle Menu
主页
在线Java编译器
教程
Java 教程
Spring 教程
博客
博客列表
Spring Boot
检查你对自动配置与 Starters 等特性的掌握。
1. Spring Boot应用的主类通常使用哪个注解标注?
@SpringBootApplication
@SpringApplication
@BootApplication
@EnableSpringBoot
2. @RestController注解组合了哪两个注解的功能?
@Controller和@ResponseBody
@Service和@ResponseBody
@Component和@ResponseStatus
@Repository和@ResponseBody
3. Spring Boot默认的配置文件名是什么?
application.properties
springboot.properties
config.properties
app.properties
4. 哪个注解用于启用Spring Boot的自动配置功能?
@EnableAutoConfiguration
@AutoConfigure
@SpringAutoConfiguration
@EnableConfiguration
5. Spring Boot应用的标准入口点方法是?
main()
run()
start()
init()
6. 以下哪个不是Spring Boot默认支持的嵌入式服务器?
Tomcat
Jetty
Nginx
Undertow
7. @Value注解的主要作用是?
注入配置文件中的值
定义Bean
启用事务管理
处理HTTP GET请求
8. Spring Boot Starters的核心作用是?
简化依赖管理
提供图形化界面
生成XML配置文件
优化数据库查询性能
9. 以下哪些是Spring Boot官方提供的Starter依赖?
spring-boot-starter-web
spring-boot-starter-data-jpa
spring-boot-starter-test
spring-boot-starter-custom
10. 可用于排除Spring Boot自动配置类的方式有?
@SpringBootApplication的exclude属性
@EnableAutoConfiguration的exclude属性
配置文件中设置spring.autoconfigure.exclude
删除对应Starter依赖
11. 哪些注解可用于定义Spring Bean?
@Component
@Service
@Repository
@Bean
12. Spring Boot Actuator提供的功能包括?
健康检查(health)
指标信息(metrics)
环境配置(env)
代码热部署
13. Spring Boot支持的配置文件格式有?
.properties
.yml
.xml
.json
14. Spring Boot应用必须使用XML配置文件。
True
False
15. @Autowired注解仅支持字段注入方式。
True
False
16. Spring Boot DevTools可以实现代码热部署。
True
False
17. application.yml文件的优先级高于application.properties。
True
False
18. Spring Boot中用于标记配置类的注解是什么?
19. Spring Boot应用的默认HTTP端口号是多少?
20. 什么注解用于将方法返回值注册为Spring容器中的Bean?
Reset
Answered 0 of 0 — 0 correct