SCOPE OF BEANS IN SPRING FRAMEWORK

Posted Posted in Uncategorized

Every Bean is associated with a scope.When you make a getBean(“bean Id”) call spring container determines which bean to return using the scope of the bean.The default scope of every bean is singleton and there are total 4 types of scope of a bean. Types of scope of a bean: Singleton Prototype request session globalSession […]

READING PROPERTY FILE IN SPRING FRAMEWORK

Posted Posted in Uncategorized

There will be times when you have to read property file, like for an example reading database credentials like username, password, connection URL and much more from a property file.To do that spring provides a class called PropertySourcesPlaceholderConfigurer using which you can read the property file content and use it into your application.Let’s implement an application in […]

Types of Dependency Injection in spring framework

Posted Posted in Uncategorized

Types of Dependency Injection in spring framework: There are basically two types of dependency injection which are – Setter Injection. Constructor Injection. There are generally three types of dependency which we inject: Dependent Object(Class object). String and int, long…etc(primitive types). Collections(List,Set,Map…etc). Here the “types of dependency which we inject” are basically the types of argument […]