Solved

injecting property through spring applicationContext.xml

Posted on 2011-03-11
3
554 Views
Last Modified: 2012-08-13
Hi,

can we inject null list collection object while injecting property through applicationContext.xml bean id definition within propery attribute. Any ideas, suggestions, sample code, resources, links highly appreciated. thanks in advance
0
Comment
Question by:gudii9
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 167 total points
ID: 35107947
Property is null by default so no need inject anything.
0
 
LVL 20

Assisted Solution

by:Sathish David Kumar N
Sathish David  Kumar N earned 166 total points
ID: 35111390
factory-bean/factory-method doesn't work with null value so it will error.
0
 
LVL 2

Assisted Solution

by:brain_box
brain_box earned 167 total points
ID: 35114772
You are not obligated to define all fields of a class in spring-config. If it is a must to define them in the config, you can utilize the NULL Object pattern. This is a better way of handling null values and also to avoid null pointers at runtime.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now