singleton: single embodiment, refers to a container exists only one Bean
prototype: every request (each time) to create a new instance
Bean.xml written in a way
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="sayHelloId" class="IOC.bbeanScope.SayHello" scope="singleton"> <property name="message" value="Hello To SayHello!"/> </bean> <bean id="sayHelloId2" class="IOC.bbeanScope.SayHello" scope="prototype"> <property name="message" value="Hello To SayHello!"/> </bean> </beans>