Câu hỏi: HSF302 Làm việc với Spring Framework – Bộ ôn tập thi lại số 2
50 câu trắc nghiệm kèm lời giải của môn HSF302 - Làm việc với Spring Framework, xếp đúng thứ tự trong đề.
Danh sách câu hỏi
LabelButtonTextFieldImageViewControllerHandlerMappingDispatcherServletViewResolverHandlerMappingHandlerAdapterViewResolverModelAndViewStackPaneBorderPaneHBoxVBoxĐáp án đúng: "Autoconfiguration → configure beans from classpath & properties; Actuator → health/metrics endpoints; DevTools → auto-restart & LiveReload". Auto-configuration xem thư viện có trên classpath và các thuộc tính trong application.properties để tự tạo bean phù hợp, ví dụ thấy Hibernate và DataSource thì dựng EntityManagerFactory; Actuator mở các endpoint giám sát như health, metrics, info; DevTools tự khởi động lại khi mã thay đổi và kích hoạt LiveReload cho trình duyệt, nên cả ba cặp đều khớp. "SpringApplication → compile JPQL; Actuator → serve JSP; DevTools → manage database migrations" sai cả ba: SpringApplication khởi động ứng dụng, JPQL do JPA provider dịch, Actuator không phục vụ JSP, còn migration là việc của Flyway hay Liquibase. "CLI → container orchestration; Actuator → live code reload; Autoconfiguration → command scheduling" sai vì Spring Boot CLI dùng để chạy nhanh script và tạo dự án chứ không điều phối container, nạp lại mã là việc của DevTools, còn lên lịch tác vụ dùng @Scheduled. "Starter POMs → replace the need for Maven/Gradle; Embedded servers → remove HTTP support" sai vì starter là gói phụ thuộc vẫn cần Maven hoặc Gradle để quản lý, còn máy chủ nhúng như Tomcat chính là thứ cung cấp HTTP.