Complete Spring 7 & Spring Boot 4 course from beginner to Advance using first thought principle.
Curated by: Coder Army (29 videos)
In this video, we will understand Spring XML-Based Configuration from the basics. Before annotations became common in Spring, XML configuration was one of the main ways to define beans, inject dependencies, manage scopes, and control bean lifecycle methods. In this lecture, we will see how Spring uses XML files like `beans.xml` to create and manage objects inside the IoC container. We will cover: * Why XML configuration exists in Spring * What configuration metadata means * How Spring converts XML into BeanDefinition objects * How to create your first bean using `bean` * How to load XML using `ClassPathXmlApplicationContext` * How to get beans by name and type * Difference between `id`, `name`, and aliases * Constructor injection in XML * Setter injection in XML * Difference between `value` and `ref` * How to handle duplicate beans * XML autowiring using `byName`, `byType`, and `constructor` * Singleton and prototype scope in XML * Bean lifecycle using `init-method` and `destroy-method` * Collection injection using List and Map * Splitting XML files using `import` * Can XML and annotations work together? This video is important if you want to understand older Spring projects, legacy codebases, and the internal foundation of Spring’s IoC container. Even if modern Spring applications mostly use annotations and Java-based configuration, XML configuration helps you understand how Spring actually manages beans behind the scenes. By the end of this video, you will clearly understand how XML-based configuration works in Spring Core and why it is still important to learn. JAVA Beginner to Advance Series : https://youtube.com/playlist?list=PLQEaRBV9gAFsR15tNo2QLF9d2qc-c018p&si=lNuF5lyt4nKz9Up7 Join System Design WhatsApp Group: https://www.whatsapp.com/channel/0029VbBF1XKF1YlMyYuPM23s Code and Notes: Github : https://github.com/adityatandon15/Spring-Framework-Full-Course We have paid courses on DSA, Web Development , Blockchain, System Design & GenAI. Join Courses: https://strikes.in/ Coder Army Website: https://coderarmy.in/#home Coder Army App: https://play.google.com/store/apps/details?id=com.rohit.negi Connect with Aditya Tandon Instagram : https://www.instagram.com/adityatandon2 LinkedIn : https://www.linkedin.com/in/adityatandon2 Twitter : https://x.com/adityatandon02 Timestamp: 00:00 Intro 05:36 Quick Recap of Annotation config 11:00 Adding Beans.xml file 14:56 Creating first bean using XML 22:16 Get Bean by type/Id 27:40 Adding second bean 31:54 Injecting dependencies in beans 35:10 Constructor Injection 37:28 Making constructor complex 42:58 Setter Injection 47:22 Multiple beans of same type 56:42 Prototype scope 57:54 Injecting collections to beans 01:03:12 Postconstruct and Predestroy alternatives 01:07:04 Organising XML in multiple files 01:10:00 Outro #SpringFramework #SpringCore #SpringXMLConfiguration #DependencyInjection #IoCContainer #JavaBackend #SpringBoot #SpringTutorial #JavaDeveloper