The 30 second answer
Spring Boot didn't invent Java configuration; Spring Framework already had @Configuration, @Bean, @Import and component scanning. What Spring Boot adds is auto-configuration for common infrastructure, plus externalized settings bound with @ConfigurationProperties. An embedded server also removes the usual need for a web deployment descriptor. So most applications no longer need XML, but @ImportResource still lets me bring in existing XML configuration when migrating an older application.
Classic Spring needed XML for three jobs. Each one has a replacement.
1. Declaring beans → Java config and scanning (Spring Framework).
@Configuration
class PaymentConfig {
@Bean
PaymentClient paymentClient(RestClient.Builder builder) {
return new PaymentClient(builder.baseUrl("https://pay.example").build());
}
}@Configuration plus @Bean replaces <bean> elements, @Import replaces <import>, and @ComponentScan replaces <context:component-scan>.
2. Infrastructure beans → auto-configuration (Spring Boot). Before Spring Boot you declared a DataSource, a transaction manager, a DispatcherServlet, view resolvers and message converters yourself. Auto-configuration now creates them when the right classes are on the classpath, and backs off when you define your own.
3. Deployment descriptors → embedded server (Spring Boot). web.xml registered the DispatcherServlet and filters in an external container. With Spring Boot, the app starts its own embedded server. The DispatcherServlet is registered by DispatcherServletAutoConfiguration, and any Filter or Servlet bean is registered automatically.
4. Placeholders and property files → externalized config. <context:property-placeholder> is replaced by the Environment, which Spring Boot fills from application.properties/.yml, environment variables and arguments. @ConfigurationProperties binds them to typed objects:
@ConfigurationProperties("payments")
record PaymentProperties(URI baseUrl, Duration timeout) { }XML is still possible:
@SpringBootApplication
@ImportResource("classpath:legacy-beans.xml")
class App { }This is useful when migrating an old application step by step.
Interview distinction: Java config is a Spring Framework feature (since Spring 3.0). Spring Boot did not invent it. What Spring Boot removed is the need to write the infrastructure configuration at all.