Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

injecting property through spring applicationContext.xml

Posted on 2011-03-11
3
Medium Priority
?
581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 668 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 664 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 668 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

647 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