Showing posts with label Auto-Wiring. Show all posts
Showing posts with label Auto-Wiring. Show all posts

Wednesday, 18 July 2018

What is no Auto-wiring mode in Spring?

Enjoying This Tutorial?

Subscribe to Ram N Java for high-quality, practical Java and Spring tutorials!

SUBSCRIBE NOW

Introduction

Auto-wiring in the Spring Framework allows the IoC container to automatically resolve and inject dependencies between collaborating beans. By default, Spring sets the autowiring mode to no (or default). In this mode, Spring does not automatically wire any collaborator beans; all dependencies must be explicitly wired by the developer.

What Is "no" Auto-Wiring Mode?

  • Default Configuration: When you do not specify an autowire attribute on the <bean> tag, Spring defaults to autowire="no".
  • Explicit Wiring Required: All object references must be explicitly defined using <property ref="..."/> or <constructor-arg ref="..."/> tags.
  • Maximum Clarity and Control: While it requires slightly more XML code, explicit wiring prevents accidental wiring errors and makes large application configurations easy to track and audit.

Step-by-Step Configuration Example

Here is an example showing how beans are configured when autowire="no" is in effect:

1. Bean Configuration in applicationContext.xml

Dependencies are explicitly linked using the ref attribute:

<!-- Dependent Bean -->
<bean id="address" class="com.ram.model.Address">
    <property name="city" value="Bangalore" />
    <property name="state" value="Karnataka" />
</bean>

<!-- Bean configured with autowire="no" (explicit wiring required) -->
<bean id="employee" class="com.ram.model.Employee" autowire="no">
    <property name="id" value="101" />
    <property name="name" value="Ram" />
    <property name="address" ref="address" />
</bean>

2. Executing with ApplicationContext

ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

Employee emp = (Employee) context.getBean("employee");
emp.displayInfo();

Key Takeaway

The autowire="no" setting is best suited for complex enterprise systems where explicit configuration is preferred to prevent ambiguity and ensure complete transparency over how components interact and wire together.


Click here to watch on Youtube:
https://www.youtube.com/watch?v=7hsOwqdiZYI&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge:

What is no Auto-wiring mode in Spring?
pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0%20http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ram.core</groupId>
    <artifactId>SpringDemo</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>SpringDemo</name>
    <url>http://maven.apache.org</url>

    <properties>
        <spring.version>5.0.2.RELEASE</spring.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <!-- Spring 5 dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
    </dependencies>
</project>

Address.java

package com.ram.model;

public class Address
{
    private String city;
    private String state;
    private String country;

    public Address(String city, String state, String country)
    {
        this.city = city;
        this.state = state;
        this.country = country;
    }

    @Override
    public String toString()
    {
        return "Address [city=" + city + ", state=" + state + ", country="
                + country + "]";
    }

}

Employee.java

package com.ram.model;

public class Employee
{
    private String name;
    private Address address;

    public Employee(String name)
    {
        System.out.println("Employee(String name) constructor "
                + "is called by the Spring container");
        this.name = name;
    }

    public Employee(String name, Address address)
    {
        System.out.println("Employee(String name, Address address) "
                + "constructor is called by the Spring container");
        this.name = name;
        this.address = address;
    }

    public void displayEmployeeDetails()
    {
        System.out.println(
                "Employee [name=" + name + ", address=" + address + "]");
    }

}

applicationContext.xml

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">


    <bean id="address" class="com.ram.model.Address" >
        <constructor-arg value="Chennai"></constructor-arg>
        <constructor-arg value="Tamil Nadu"></constructor-arg>
        <constructor-arg value="India"></constructor-arg>
    </bean>

    <bean id="employee" class="com.ram.model.Employee" autowire="no">
        <constructor-arg value="Peter"></constructor-arg>
    </bean>

</beans>


App.java

package com.ram.core;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ram.model.Employee;

public class App
{
    public static void main(String[] args)
    {
        ApplicationContext context = new ClassPathXmlApplicationContext(
                "applicationContext.xml");

        System.out.println("---------------------------------------");

        Employee employee = (Employee) context.getBean("employee");
        System.out.println(
                "Got employee object from the ApplicationContext[Spring Container]");
       
        employee.displayEmployeeDetails();
    }

}

Output

Jul 03, 2018 9:15:42 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5b37e0d2: startup date [Tue Jul 03 09:15:42 IST 2018]; root of context hierarchy
Jul 03, 2018 9:15:42 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Employee(String name) constructor is called by the Spring container
---------------------------------------
Got employee object from the ApplicationContext[Spring Container]
Employee [name=Peter, address=null]

Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/SpringDemo_no_Autowiring.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/javaee/tree/master/Spring_2018/SpringDemo_no_Autowiring

Bitbucket Link:
https://bitbucket.org/ramram43210/spring/src/a2a3948db9c8932cede027a3aaf7ba5a87170ed8/Spring_2018/SpringDemo_no_Autowiring/?at=master

See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • Monday, 16 July 2018

    What is Constructor Auto-wiring mode in Spring?

    Enjoying This Tutorial?

    Subscribe to Ram N Java for high-quality, practical Java and Spring tutorials!

    SUBSCRIBE NOW

    Introduction

    Auto-wiring in Spring allows the container to automatically resolve and inject collaborating beans without requiring manual <constructor-arg ref="..."/> declarations. When using constructor autowiring mode (autowire="constructor"), the Spring IoC container inspects the bean's constructor parameter types and injects matching bean instances configured in the context.

    How Does Constructor Auto-Wiring Work?

    • Type Matching: Similar to byType autowiring, Spring searches the application context for beans whose data types match each argument of the constructor.
    • Constructor Selection: If a class contains multiple overloaded constructors, Spring selects the greediest constructor whose parameters can all be satisfied by existing beans in the context.
    • Guaranteed Immutability: Because dependencies are passed through the constructor, the bean can be instantiated as fully initialized and immutable.
    • No Multiple Matches Allowed: If more than one candidate bean of the exact same type exists in the container, Spring throws an UnsatisfiedDependencyException due to ambiguity.

    Step-by-Step Configuration Example

    Consider an Employee class that receives an Address dependency strictly via its constructor:

    1. The Java Model Class

    package com.ram.model;
    
    public class Employee {
        private Address address;
    
        // Constructor for autowiring
        public Employee(Address address) {
            this.address = address;
        }
    
        public void display() {
            System.out.println("Employee address: " + address);
        }
    }

    2. Configuring autowire="constructor" in XML

    Notice that the employee bean does not need explicit <constructor-arg> tags:

    <!-- Dependent Bean -->
    <bean id="address" class="com.ram.model.Address">
        <property name="city" value="Bangalore" />
        <property name="state" value="Karnataka" />
    </bean>
    
    <!-- Employee Bean with Constructor Auto-Wiring -->
    <bean id="employee" 
          class="com.ram.model.Employee" 
          autowire="constructor" />

    3. Loading the Application Context

    ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    
    Employee emp = (Employee) context.getBean("employee");
    emp.display();

    Key Takeaway

    Constructor autowiring combines the benefits of constructor-based dependency injection (immutability and mandatory dependency enforcement) with automated container wiring, keeping your XML configuration clean and concise.


    Click here to watch on Youtube:
    https://www.youtube.com/watch?v=iyKVa2Za5As&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge:
    What is Constructor Auto-wiring mode in Spring?

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0%20http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.ram.core</groupId>
        <artifactId>SpringDemo</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>SpringDemo</name>
        <url>http://maven.apache.org</url>

        <properties>
            <spring.version>5.0.2.RELEASE</spring.version>
        </properties>

        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>

            <!-- Spring 5 dependencies -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
        </dependencies>
    </project>

    Address.java

    package com.ram.model;

    public class Address
    {
        private String city;
        private String state;
        private String country;

        public Address(String city, String state, String country)
        {
            this.city = city;
            this.state = state;
            this.country = country;
        }

        @Override
        public String toString()
        {
            return "Address [city=" + city + ", state=" + state + ", country="
                    + country + "]";
        }

    }

    Employee.java

    package com.ram.model;

    public class Employee
    {
        private String name;
        private Address address;

        public Employee(String name)
        {
            System.out.println("Employee(String name) constructor "
                    + "is called by the Spring container");
            this.name = name;
        }

        public Employee(String name, Address address)
        {
            System.out.println("Employee(String name, Address address) "
                    + "constructor is called by the Spring container");
            this.name = name;
            this.address = address;
        }

        public void displayEmployeeDetails()
        {
            System.out.println(
                    "Employee [name=" + name + ", address=" + address + "]");
        }

    }

    applicationContext.xml

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">


        <bean id="address" class="com.ram.model.Address" >
            <constructor-arg value="Chennai"></constructor-arg>
            <constructor-arg value="Tamil Nadu"></constructor-arg>
            <constructor-arg value="India"></constructor-arg>
        </bean>

        <bean id="employee" class="com.ram.model.Employee" autowire="constructor">
            <constructor-arg value="Peter"></constructor-arg>
        </bean>

    </beans>


    App.java

    package com.ram.core;

    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;

    import com.ram.model.Employee;

    public class App
    {
        public static void main(String[] args)
        {
            ApplicationContext context = new ClassPathXmlApplicationContext(
                    "applicationContext.xml");

            System.out.println("---------------------------------------");

            Employee employee = (Employee) context.getBean("employee");
            System.out.println(
                    "Got employee object from the ApplicationContext[Spring Container]");
           
            employee.displayEmployeeDetails();
        }

    }

    Output
    Jul 01, 2018 10:27:21 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5b37e0d2: startup date [Sun Jul 01 10:27:21 IST 2018]; root of context hierarchy
    Jul 01, 2018 10:27:21 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
    Employee(String name, Address address) constructor is called by the Spring container
    ---------------------------------------
    Got employee object from the ApplicationContext[Spring Container]
    Employee [name=Peter, address=Address [city=Chennai, state=Tamil Nadu, country=India]

    Click the below link to download the code:
    https://sites.google.com/site/ramj2eev2/java_basics/SpringDemo_Constructor_Autowiring.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/javaee/tree/master/Spring_2018/SpringDemo_Constructor_Autowiring

    Bitbucket Link:
    https://bitbucket.org/ramram43210/spring/src/a2a3948db9c8932cede027a3aaf7ba5a87170ed8/Spring_2018/SpringDemo_Constructor_Autowiring/?at=master

    See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • What will happen in byType Auto wiring mode, multiple bean of one type is there?

    Enjoying This Tutorial?

    Subscribe to Ram N Java for high-quality, practical Java and Spring tutorials!

    SUBSCRIBE NOW

    Introduction

    In the Spring Framework, byType autowiring allows the container to automatically inject a dependency into a setter method if exactly one bean matches the property's data type. But what happens if multiple beans of that same data type are defined in your XML configuration? Let us explore how the Spring container responds and how to resolve the resulting ambiguity.

    What Happens When Multiple Beans of the Same Type Exist?

    • Fatal Exception Thrown: If more than one candidate bean of the expected type is present in the ApplicationContext, Spring cannot choose which one to inject.
    • NoUniqueBeanDefinitionException: Spring throws a fatal NoUniqueBeanDefinitionException (or UnsatisfiedDependencyException), preventing application context initialization.
    • Resolution Techniques: You can resolve this issue by marking one bean as primary (primary="true"), excluding beans with autowire-candidate="false", switching to byName autowiring, or using explicit wiring.

    The Ambiguity Scenario Illustrated

    Consider two Address beans configured in applicationContext.xml, while an Employee bean uses autowire="byType":

    1. Problematic Configuration

    <!-- Multiple beans of the same type (Address) -->
    <bean id="address1" class="com.ram.model.Address">
        <property name="city" value="Bangalore" />
    </bean>
    
    <bean id="address2" class="com.ram.model.Address">
        <property name="city" value="Hyderabad" />
    </bean>
    
    <!-- byType autowiring encounters ambiguity here -->
    <bean id="employee" 
          class="com.ram.model.Employee" 
          autowire="byType" />

    2. Container Exception Result

    org.springframework.beans.factory.NoUniqueBeanDefinitionException: 
    No qualifying bean of type 'com.ram.model.Address' available: 
    expected single matching bean but found 2: address1,address2

    Key Takeaway

    When using autowire="byType", Spring guarantees type safety only when exactly one qualifying bean is present. To avoid fatal runtime exceptions when multiple beans share the same type, make sure to designate a primary candidate, use qualifier annotations, or switch to explicit bean references.


    Click here to watch on Youtube:
    https://www.youtube.com/watch?v=wt0kUXuMWpQ&list=UUhwKlOVR041tngjerWxVccw

    Click the below Image to Enlarge:

    What will happen in byType Auto wiring mode, multiple bean of one type is there?

    What will happen in byType Auto wiring mode, multiple bean of one type is there?

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0%20http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.ram.core</groupId>
        <artifactId>SpringDemo</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>SpringDemo</name>
        <url>http://maven.apache.org</url>

        <properties>
            <spring.version>5.0.2.RELEASE</spring.version>
        </properties>

        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>

            <!-- Spring 5 dependencies -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
        </dependencies>
    </project>

    Address.java

    package com.ram.model;

    public class Address
    {
        private String city;
        private String state;
        private String country;

        public Address(String city, String state, String country)
        {
            this.city = city;
            this.state = state;
            this.country = country;
        }

        @Override
        public String toString()
        {
            return "Address [city=" + city + ", state=" + state + ", country="
                    + country + "]";
        }

    }

    Employee.java

    package com.ram.model;

    public class Employee
    {
        private int id;
        private String name;
        private Address address;

        public int getId()
        {
            return id;
        }

        public void setId(int id)
        {
            this.id = id;
        }

        public String getName()
        {
            return name;
        }

        public void setName(String name)
        {
            this.name = name;
        }

        public Address getAddress()
        {
            return address;
        }

        public void setAddress(Address address)
        {
            this.address = address;
        }

        public void displayEmployeeDetails()
        {
            System.out.println("Employee [id=" + id + ", name=" + name
                    + ", address=" + address + "]");
        }

    }

    applicationContext.xml

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">


        <bean id="address1" class="com.ram.model.Address">
            <constructor-arg value="Chennai"></constructor-arg>
            <constructor-arg value="Tamil Nadu"></constructor-arg>
            <constructor-arg value="India"></constructor-arg>
        </bean>

        <bean id="address2" class="com.ram.model.Address">
            <constructor-arg value="Bangalore"></constructor-arg>
            <constructor-arg value="Karnataka"></constructor-arg>
            <constructor-arg value="India"></constructor-arg>
        </bean>

        <bean id="employee" class="com.ram.model.Employee" autowire="byType">
            <property name="id" value="100"></property>
            <property name="name" value="Peter"></property>
        </bean>

    </beans>


    App.java

    package com.ram.core;

    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;

    import com.ram.model.Employee;

    public class App
    {
        public static void main(String[] args)
        {
            ApplicationContext context = new ClassPathXmlApplicationContext(
                    "applicationContext.xml");

            System.out.println("---------------------------------------");

            Employee employee = (Employee) context.getBean("employee");
            System.out.println(
                    "Got employee object from the ApplicationContext[Spring Container]");
            employee.displayEmployeeDetails();

        }

    }

    Output

    Jun 30, 2018 8:41:53 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5b37e0d2: startup date [Sat Jun 30 08:41:53 IST 2018]; root of context hierarchy
    Jun 30, 2018 8:41:53 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
    Jun 30, 2018 8:41:53 AM org.springframework.context.support.AbstractApplicationContext refresh
    WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'employee' defined in class path resource [applicationContext.xml]: Unsatisfied dependency expressed through bean property 'address'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.ram.model.Address' available: expected single matching bean but found 2: address1,address2
    Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'employee' defined in class path resource [applicationContext.xml]: Unsatisfied dependency expressed through bean property 'address'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.ram.model.Address' available: expected single matching bean but found 2: address1,address2
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1439)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1326)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:758)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.ram.core.App.main(App.java:12)
    Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.ram.model.Address' available: expected single matching bean but found 2: address1,address2
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:215)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1113)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1424)
        ... 13 more

    Click the below link to download the code:
    https://sites.google.com/site/ramj2eev2/java_basics/SpringDemo_byType_Autowiring_multiplebean.zip?attredirects=0&d=1

    Github Link:
    https://github.com/ramram43210/javaee/tree/master/Spring_2018/SpringDemo_byType_Autowiring_multiplebean

    Bitbucket Link:
    https://bitbucket.org/ramram43210/spring/src/a2a3948db9c8932cede027a3aaf7ba5a87170ed8/Spring_2018/SpringDemo_byType_Autowiring_multiplebean/?at=master

    See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • Tutorials