在spring2.0中只有5种作用域即:singleton(单例)、prototype,Spring2.0以后,增加了session、request、global session三种专用于Web应用程序上下文的Bean。spring中默认为singleton
singleton:每次调用getBean的时候返回相同的实例
<bean id="role" class="spring.bean" scope="prototype"/>
prototype:每次调用getBean的时候返回不同的实例