Solved

injecting property through spring applicationContext.xml

Posted on 2011-03-11
3
557 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 123
Java Server Faces parameter pass? 6 37
VB Script to add site to Java Exception List 4 48
Error trying to install RTMT Win7 5 38
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 “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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

929 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

11 Experts available now in Live!

Get 1:1 Help Now