Warning: include(../include/breadcrumb.php): Failed to open stream: No such file or directory in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 22

Warning: include(): Failed opening '../include/breadcrumb.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 22

Warning: include(./spring-ioc-sidenav.php): Failed to open stream: No such file or directory in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 27

Warning: include(): Failed opening './spring-ioc-sidenav.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 27

Explanation with example for @Qualifier

Let’s say we have two beans qualified to be injected then we go for this.

Change code as below :


Now we will see how we can inject primitives from property files.

Change spConfig.xml as below.

  • We need to inform spring where is out properties file located.

  • Create property file in resources folder

  • Use annotation @value for injecting values.

  • Value may be multiple [comma separated ] or single

  • Client for invocation

  • We are using this for DB Connection in this case.

Spconfig.xml


DB.properties


DBUtil.java



Warning: include(../include/google-vertical-ads.php): Failed to open stream: No such file or directory in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 165

Warning: include(): Failed opening '../include/google-vertical-ads.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 165

Warning: include(../include/internal-page-footer.php): Failed to open stream: No such file or directory in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 205

Warning: include(): Failed opening '../include/internal-page-footer.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/javabykiran/public_html/thekiranacademy.com/tutorials/qualifier-annotation-in-spring-ioc.php on line 205