Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

Search In

How to exclude a bean from auto-wiring?

When configuring beans in configuration file, set the "autowire-candidate" attribute of the bean element in .xml file to false, by doing this the container will exclude that specific bean from auto-wiring. By using the below example we can easily sh

How to use Autowire With Qualifiers?

In Spring we use @Qualifier to indicate which bean we want to qualify to autowired on a field. when we create multiple beans of the same type( for example: Department) and want to autowire only one of them with a property in some other class (for ex

BeanPostProcessor Interface Basic Example in Spring

BeanPostProcessor :- it is a interface that defines callback methods by that you can provide your own instantiation logic and your own custom logic before and after the bean creation.by this we can perform some additional or our own task before and

BeanPostProcessor in Spring

BeanPostProcessor :- It is an interface that defines callback methods by which you can provide your own instantiation logic and your own custom logic before and after the bean creation. along with this you can perform some additional logic or your

@Resource annotaion in Spring

@Resource annotation allows you to specify a name of the injected bean. @Resource annotation takes a 'name' attribute which will be treated as the bean name we want to inject in the class. In other words we can say, it follows by-name autowiring ( sa

Spring @PostConstruct and @PreDestroy

Spring Framework @PostConstruct and @PreDestroy annotations are used to just like life cycle callback methods. @PostConstruct and @PreDestroy are used widely for the process of bean initialization and to free resources at the time of bean destruction

Spring @Component Example

In Spring Framework normally we register all our components or beans in the XML configuration file. So when program runs spring container scan this XML file for beans and instantiate the bean components as per requirement. In the case of big projects

Destrction method of bean lifecyle in spring

Destruction Methods:- the destroy method of spring bean container it can specified a method that is called just before a bean is removed from the spring container. Address.java package com.chandan; public class Address { private String

Destrction method of bean lifecyle in spring

Destruction Methods:-The destruction method of a spring bean container is called when bean is removed from the spring container. Example: Address.java package com.chandan; public class Address { private String city; public Address

@Import annotation in Spring

@Import :- In Spring 3.0 we can also use the Java based Configuration instead of large XML files. We can define the bean with the help of Java files and we can also load these multiple JavaConfig file using @Import annotation in single JavaConfig fi

1 8 26
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: