In this tutorial you will see how to check for unresolved dependencies of a bean that is deployed into the spring IoC container. It check for all bean's dependencies, that is expressed in its properties are satisfied or not. The dependency-check attribute is set in the <bean/> element. The dependency-check have four modes.
| Mode | Explanation |
| none | It is default which tells no dependency checking is to be done. The properties of the bean that have no value specified will not be set. |
| simple | Dependency checking for only primitive types and collections. |
| object | Dependency checking for only collaborators only. |
| all | Dependency checking for all primitive types, collections and collaborators. |
Lets see an example of different mode of dependency-check.
StudentBean.java
package spring.dependency.check.mode;
|
DependecyCheckMain.java
package spring.dependency.check.mode;
|
context.xml
<beans xmlns="http://www.springframework.org/schema/beans"
|
| StudentBean{RollNo=101, nestedStudentBean=null} StudentBean{RollNo=0, nestedStudentBean=StudentBean{RollNo=0, nestedStudentBean=null}} StudentBean{RollNo=101, nestedStudentBean=StudentBean{RollNo=0, nestedStudentBean=null}} |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.