Skip to content

Instantly share code, notes, and snippets.

@madan712
Created January 3, 2013 15:18
Show Gist options
  • Save madan712/4444228 to your computer and use it in GitHub Desktop.
Save madan712/4444228 to your computer and use it in GitHub Desktop.
Spring - How to inject List/ Map using bean? We have a class Country.java with two instance variables city and president. We will set those values using applicationContext.xml
package com.javaxp;
import java.util.ArrayList;
import java.util.HashMap;
public class Country {
private HashMap city;
private ArrayList president;
public HashMap getCity() {
return city;
}
public void setCity(HashMap city) {
this.city = city;
}
public ArrayList getPresident() {
return president;
}
public void setPresident(ArrayList president) {
this.president = president;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment