Bean A depends on another Bean B. (Bean B is a property of Bean A).
I want Bean B sometime have objects and sometimes be null.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The simple answer is Yes. In terms of Spring 2.x XML (and this will work in 3.x):
You can build on this to expand ‘B’ so that it has its own properties:
You can make B null with respect to A by changing you XML so that B is not injected into A