SPRING CORE / CATATAN</>↗Spring Core09 Mei 2012
In this example you will see how to use the <set> element to wire a collection property of a bean. We will reuse the bean that we use in the previous example How do I inject collections using list element in Spring?. The Album bean have a songs property that have a type of java.util.List. […]
SPRING CORE / CATATAN</>↗Spring Core09 Mei 2012
The following example show you how to use the <list> element to wire collection property. We can use it to wire property of either arrays or some implementation of java.util.Collection such as java.util.ArrayList. For this example we will create a bean called Album that have a collection of Song beans in it. So here is […]
SPRING CORE / CATATAN</>↗Spring Core09 Mei 2012
Beside injecting a simple value (using the value attribute) and a reference to other bean (using the ref attribute). We can also inject collections properties into a bean. Spring provides four ways to inject collections. There are <list> and <set> that can be used to inject arrays or any implementation of java.util.Collection. The <map> that […]
SPRING CORE / CATATAN</>↗Spring Core08 Mei 2012
Beside using the <property> element, Spring framework also provide us another way to wiring value or reference into the bean. We can use the Spring’s p namespaces. The p namespace has a schema URI of `http://www.springframework.org/schema/p`. With this namespace declared in the Spring configuration file you can use the p: prefixed attribute of the <bean> […]
SPRING CORE / CATATAN</>↗Spring Core07 Mei 2012
Inner bean is a bean defined inside another bean, it can be seen as an inner class. In another word, the inner bean is a bean defined within the scope of another bean. In this case the inner bean can only be use by the outer bean. No other bean in the Spring context can […]
SPRING CORE / CATATAN</>↗Spring Core01 Mei 2012
A bean usually have some private properties that can be accessed through a pair of accessor methods, the setters and getters. These setters, the setXXX() method can be used by Spring Framework to configure the beans. This method of injecting beans property through their setter methods is called the setter injection. The following example will […]